summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WinCOFFStreamer.cpp
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2012-12-07 19:13:57 +0000
committerEli Bendersky <eliben@google.com>2012-12-07 19:13:57 +0000
commita31a894eede101b92dabd67d553d901db50e7ab5 (patch)
tree112c914abd02d7326a94583a06c2d523bb5e72ab /llvm/lib/MC/WinCOFFStreamer.cpp
parent95afbf517afc7d8bee70cfde65cfc4fa0093956d (diff)
downloadbcm5719-llvm-a31a894eede101b92dabd67d553d901db50e7ab5.tar.gz
bcm5719-llvm-a31a894eede101b92dabd67d553d901db50e7ab5.zip
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 llvm-svn: 169626
Diffstat (limited to 'llvm/lib/MC/WinCOFFStreamer.cpp')
-rw-r--r--llvm/lib/MC/WinCOFFStreamer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/MC/WinCOFFStreamer.cpp b/llvm/lib/MC/WinCOFFStreamer.cpp
index 8c8ae3f0b3c..359b388618e 100644
--- a/llvm/lib/MC/WinCOFFStreamer.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud