diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-20 06:45:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-20 06:45:39 +0000 |
commit | 45eeffcc2ac48cda51127f094a418c7c99a9cb3a (patch) | |
tree | e24ae641ac55330378a5c7df18fa22f2839f6798 /llvm/lib/MC/MCAsmStreamer.cpp | |
parent | 38caaf14c11aaef054cd60687d92c0248f7768f5 (diff) | |
download | bcm5719-llvm-45eeffcc2ac48cda51127f094a418c7c99a9cb3a.tar.gz bcm5719-llvm-45eeffcc2ac48cda51127f094a418c7c99a9cb3a.zip |
make mcasmstreamer handle expanding 8 byte integer constants to
4-byte constants if .quad isn't supported. Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.
llvm-svn: 93987
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index 23489095893..1121232808e 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -198,14 +198,24 @@ void MCAsmStreamer::EmitBytes(StringRef Data, unsigned AddrSpace) { void MCAsmStreamer::EmitIntValue(uint64_t Value, unsigned Size, unsigned AddrSpace) { assert(CurSection && "Cannot emit contents before setting section!"); - // Need target hooks to know how to print this. const char *Directive = 0; switch (Size) { default: break; case 1: Directive = MAI.getData8bitsDirective(AddrSpace); break; case 2: Directive = MAI.getData16bitsDirective(AddrSpace); break; case 4: Directive = MAI.getData32bitsDirective(AddrSpace); break; - case 8: Directive = MAI.getData64bitsDirective(AddrSpace); break; + case 8: + Directive = MAI.getData64bitsDirective(AddrSpace); + // If the target doesn't support 64-bit data, emit as two 32-bit halves. + if (Directive) break; + if (isLittleEndian()) { + EmitIntValue((uint32_t)(Value >> 0 ), 4, AddrSpace); + EmitIntValue((uint32_t)(Value >> 32), 4, AddrSpace); + } else { + EmitIntValue((uint32_t)(Value >> 32), 4, AddrSpace); + EmitIntValue((uint32_t)(Value >> 0 ), 4, AddrSpace); + } + return; } assert(Directive && "Invalid size for machine code value!"); @@ -215,7 +225,6 @@ void MCAsmStreamer::EmitIntValue(uint64_t Value, unsigned Size, void MCAsmStreamer::EmitValue(const MCExpr *Value, unsigned Size, unsigned AddrSpace) { assert(CurSection && "Cannot emit contents before setting section!"); - // Need target hooks to know how to print this. const char *Directive = 0; switch (Size) { default: break; |