summaryrefslogtreecommitdiff
path: root/bolt
diff options
context:
space:
mode:
Diffstat (limited to 'bolt')
-rw-r--r--bolt/include/bolt/Core/BinaryContext.h3
-rw-r--r--bolt/lib/Core/BinaryContext.cpp3
-rw-r--r--bolt/lib/Core/BinaryFunction.cpp3
3 files changed, 3 insertions, 6 deletions
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 26b8a64af3dc..7e2d4d6e045c 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -1227,8 +1227,7 @@ public:
Emitter = this->MCE.get();
SmallString<256> Code;
SmallVector<MCFixup, 4> Fixups;
- raw_svector_ostream VecOS(Code);
- Emitter->encodeInstruction(Inst, VecOS, Fixups, *STI);
+ Emitter->encodeInstruction(Inst, Code, Fixups, *STI);
return Code.size();
}
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index 09f59f7ad632..6a9e35e04eec 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -2289,9 +2289,8 @@ bool BinaryContext::validateInstructionEncoding(
SmallString<256> Code;
SmallVector<MCFixup, 4> Fixups;
- raw_svector_ostream VecOS(Code);
- MCE->encodeInstruction(Inst, VecOS, Fixups, *STI);
+ MCE->encodeInstruction(Inst, Code, Fixups, *STI);
auto OutputSequence = ArrayRef<uint8_t>((uint8_t *)Code.data(), Code.size());
if (InputSequence != OutputSequence) {
if (opts::Verbosity > 1) {
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 69ebd12bd0db..14a10be62d20 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -1536,8 +1536,7 @@ bool BinaryFunction::scanExternalRefs() {
// Emit the instruction using temp emitter and generate relocations.
SmallString<256> Code;
SmallVector<MCFixup, 4> Fixups;
- raw_svector_ostream VecOS(Code);
- Emitter.MCE->encodeInstruction(Instruction, VecOS, Fixups, *BC.STI);
+ Emitter.MCE->encodeInstruction(Instruction, Code, Fixups, *BC.STI);
// Create relocation for every fixup.
for (const MCFixup &Fixup : Fixups) {