diff options
author | Eli Bendersky <eliben@google.com> | 2012-12-07 19:13:57 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2012-12-07 19:13:57 +0000 |
commit | 64d9a3233476553fc950f0f2fc6a2cdd2a4c05cf (patch) | |
tree | 42e99ad39f9203c0caf206319b45449bf7723230 /lib/MC/WinCOFFStreamer.cpp | |
parent | e4ccfef809a1a47f1386bb2767b8c77e64644435 (diff) |
Refactor MCInstFragment and MCDataFragment to adhere to a common interface,
which removes code duplication and prepares the ground for future additions.
Full discussion:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/158233.html
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/WinCOFFStreamer.cpp')
-rw-r--r-- | lib/MC/WinCOFFStreamer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/MC/WinCOFFStreamer.cpp b/lib/MC/WinCOFFStreamer.cpp index 8c8ae3f0b3..359b388618 100644 --- a/lib/MC/WinCOFFStreamer.cpp +++ b/lib/MC/WinCOFFStreamer.cpp @@ -288,9 +288,10 @@ void WinCOFFStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol) { MCDataFragment *DF = getOrCreateDataFragment(); - DF->addFixup(MCFixup::Create(DF->getContents().size(), - MCSymbolRefExpr::Create (Symbol, getContext ()), - FK_SecRel_4)); + DF->getFixups().push_back( + MCFixup::Create(DF->getContents().size(), + MCSymbolRefExpr::Create (Symbol, getContext ()), + FK_SecRel_4)); DF->getContents().resize(DF->getContents().size() + 4, 0); } @@ -339,7 +340,7 @@ void WinCOFFStreamer::EmitInstruction(const MCInst &Instruction) { MCInstFragment *Fragment = new MCInstFragment(Instruction, getCurrentSectionData()); - raw_svector_ostream VecOS(Fragment->getCode()); + raw_svector_ostream VecOS(Fragment->getContents()); getAssembler().getEmitter().EncodeInstruction(Instruction, VecOS, Fragment->getFixups()); |