summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-12 21:00:38 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-12 21:00:38 +0000
commit921e79f5eb4a5114cf532f053bdfd953172dd0cc (patch)
tree135ff62a1253fe414515f9da6156c2aac51b0afd /llvm/lib
parentc7b46f9d9c715e70b1a2af87a66fcdb693ba1bbc (diff)
downloadbcm5719-llvm-921e79f5eb4a5114cf532f053bdfd953172dd0cc.tar.gz
bcm5719-llvm-921e79f5eb4a5114cf532f053bdfd953172dd0cc.zip
MC: Add MCAssembler::addFixup, which enforces that fixups are added in order.
llvm-svn: 98379
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 1a6fa411692..2d833ba351f 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -327,9 +327,8 @@ void MCMachOStreamer::EmitValue(const MCExpr *Value, unsigned Size,
for (unsigned i = 0; i != Size; ++i)
DF->getContents().push_back(uint8_t(AbsValue >> (i * 8)));
} else {
- DF->getFixups().push_back(MCAsmFixup(DF->getContents().size(),
- *AddValueSymbols(Value),
- MCFixup::getKindForSize(Size)));
+ DF->addFixup(MCAsmFixup(DF->getContents().size(), *AddValueSymbols(Value),
+ MCFixup::getKindForSize(Size)));
DF->getContents().resize(DF->getContents().size() + Size, 0);
}
}
@@ -388,9 +387,8 @@ void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {
DF = new MCDataFragment(CurSectionData);
for (unsigned i = 0, e = Fixups.size(); i != e; ++i) {
MCFixup &F = Fixups[i];
- DF->getFixups().push_back(MCAsmFixup(DF->getContents().size()+F.getOffset(),
- *F.getValue(),
- F.getKind()));
+ DF->addFixup(MCAsmFixup(DF->getContents().size()+F.getOffset(),
+ *F.getValue(), F.getKind()));
}
DF->getContents().append(Code.begin(), Code.end());
}
OpenPOWER on IntegriCloud