aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-03 02:54:21 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-03 02:54:21 +0000
commit2df042cb32ecb8d2e1d499dfa27d5074c8b40e13 (patch)
treed807e249227d692d07520e298c1c78fb0953051e /lib/MC/MCStreamer.cpp
parent6cfab3748ce62067f7ca9b731295e8b39fd72258 (diff)
downloadexternal_llvm-2df042cb32ecb8d2e1d499dfa27d5074c8b40e13.zip
external_llvm-2df042cb32ecb8d2e1d499dfa27d5074c8b40e13.tar.gz
external_llvm-2df042cb32ecb8d2e1d499dfa27d5074c8b40e13.tar.bz2
Make EmitIntValue more efficient and more like what we do for leb128. The
difference is much smaller (about 0.3s) but significant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120787 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r--lib/MC/MCStreamer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 38ace6b..6df4ae4 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -46,7 +46,12 @@ void MCStreamer::EmitDwarfSetLineAddr(int64_t LineDelta,
/// pass in a MCExpr for constant integers.
void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size,
unsigned AddrSpace) {
- EmitValue(MCConstantExpr::Create(Value, getContext()), Size, AddrSpace);
+ assert(Size <= 8);
+ char buf[8];
+ // FIXME: Endianness assumption.
+ for (unsigned i = 0; i != Size; ++i)
+ buf[i] = uint8_t(Value >> (i * 8));
+ EmitBytes(StringRef(buf, Size), AddrSpace);
}
/// EmitULEB128Value - Special case of EmitULEB128Value that avoids the