aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-06 14:53:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-06 14:53:14 +0000
commit2303c9dd69476d045af7cee94e112dd77d22fd28 (patch)
tree375625044ce3d1b57ac71a67d0f78d2a9c0073c9 /lib/MC/MCStreamer.cpp
parent03a83a3f41c4763974b6d9d9aff852c9611db44f (diff)
Add an EmitAbsValue helper method and use it in cases where we want to be sure
that no relocations are used (on MochO). Fixes llc producing different output from llc + llvm-mc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r--lib/MC/MCStreamer.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 6df4ae44e4..b9d59056f3 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -72,6 +72,12 @@ void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) {
EmitBytes(OSE.str(), AddrSpace);
}
+void MCStreamer::EmitAbsValue(const MCExpr *Value, unsigned Size) {
+ MCSymbol *ABS = getContext().CreateTempSymbol();
+ EmitAssignment(ABS, Value);
+ EmitSymbolValue(ABS, Size, 0);
+}
+
void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
unsigned AddrSpace) {
EmitValue(MCSymbolRefExpr::Create(Sym, getContext()), Size, AddrSpace);