aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MC/MCAsmStreamer.cpp')
-rw-r--r--lib/MC/MCAsmStreamer.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index ab807ed..ce85e46 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/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();
}