summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-06 17:27:56 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-06 17:27:56 +0000
commit44bbe36de66b44f7c9b7355709b62609886e287a (patch)
tree168e54e4625559ee716af456450eb1c9befdde14 /llvm/lib/MC/MCAsmStreamer.cpp
parentdee30623734e0ea86d8b4d16cae9632087e548b9 (diff)
downloadbcm5719-llvm-44bbe36de66b44f7c9b7355709b62609886e287a.tar.gz
bcm5719-llvm-44bbe36de66b44f7c9b7355709b62609886e287a.zip
Second try at making direct object emission produce the same results
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc bootstrap on darwin10 using darwin9's assembler and linker. llvm-svn: 121006
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index ab807edd9ea..ce85e462b3d 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -512,32 +512,6 @@ void MCAsmStreamer::EmitIntValue(uint64_t Value, unsigned Size,
EmitValue(MCConstantExpr::Create(Value, getContext()), Size, AddrSpace);
}
-static bool hasSymbolDifference(const MCExpr *Value) {
- switch (Value->getKind()) {
- case MCExpr::Target: llvm_unreachable("Can't handle target exprs yet!");
- case MCExpr::Constant:
- case MCExpr::SymbolRef:
- return false;
- case MCExpr::Unary:
- return hasSymbolDifference(cast<MCUnaryExpr>(Value)->getSubExpr());
- case MCExpr::Binary: {
- const MCBinaryExpr *BE = cast<MCBinaryExpr>(Value);
- if (BE->getOpcode() == MCBinaryExpr::Sub &&
- BE->getLHS()->getKind() == MCExpr::SymbolRef &&
- BE->getRHS()->getKind() == MCExpr::SymbolRef)
- return true;
- return hasSymbolDifference(BE->getLHS()) ||
- hasSymbolDifference(BE->getRHS());
- }
- }
- llvm_unreachable("Switch covers all cases");
-}
-
-bool MCAsmStreamer::needsSet(const MCExpr *Value) {
- return getContext().getAsmInfo().needsSetToChangeDiffSize() &&
- hasSymbolDifference(Value);
-}
-
void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size,
unsigned AddrSpace) {
assert(CurSection && "Cannot emit contents before setting section!");
@@ -565,14 +539,6 @@ void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size,
}
assert(Directive && "Invalid size for machine code value!");
- if (needsSet(Value)) {
- MCSymbol *SetLabel = getContext().CreateTempSymbol();
- EmitAssignment(SetLabel, Value);
- OS << Directive << *SetLabel;
- EmitEOL();
- return;
- }
-
OS << Directive << *Value;
EmitEOL();
}
OpenPOWER on IntegriCloud