diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-02 17:22:24 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-02 17:22:24 +0000 |
commit | 3ff57094a7d176a759ddb1e1668489d89064f56c (patch) | |
tree | 27726bf327a50d838d365cc73ff14d45192d0661 /lib/MC/MCStreamer.cpp | |
parent | 8bc9ef77b7e9910fbeb40725dfa49d793158db51 (diff) |
Add support for expressions in .sleb/.uleb directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r-- | lib/MC/MCStreamer.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 351d9fce4c..98667f42d6 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -37,22 +37,16 @@ void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size, EmitValue(MCConstantExpr::Create(Value, getContext()), Size, AddrSpace); } -// EmitULEB128Value - Special case of EmitValue that emits a ULEB128 of the -// Value as the sequence of ULEB128 encoded bytes. -void MCStreamer::EmitULEB128Value(uint64_t Value, unsigned AddrSpace) { - SmallString<32> Tmp; - raw_svector_ostream OS(Tmp); - MCObjectWriter::EncodeULEB128(Value, OS); - EmitBytes(OS.str(), AddrSpace); +/// EmitULEB128Value - Special case of EmitULEB128Value that avoids the +/// client having to pass in a MCExpr for constant integers. +void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned AddrSpace) { + EmitULEB128Value(MCConstantExpr::Create(Value, getContext()), AddrSpace); } -// EmitSLEB128Value - Special case of EmitValue that emits a SLEB128 of the -// Value as the sequence of ULEB128 encoded bytes. -void MCStreamer::EmitSLEB128Value(int64_t Value, unsigned AddrSpace) { - SmallString<32> Tmp; - raw_svector_ostream OS(Tmp); - MCObjectWriter::EncodeSLEB128(Value, OS); - EmitBytes(OS.str(), AddrSpace); +/// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the +/// client having to pass in a MCExpr for constant integers. +void MCStreamer::EmitSLEB128IntValue(int64_t Value, unsigned AddrSpace) { + EmitSLEB128Value(MCConstantExpr::Create(Value, getContext()), AddrSpace); } void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size, |