diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-10 00:09:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-10 00:09:21 +0000 |
commit | caea64b09806a7c6500ceaf93bde4d48d22f810f (patch) | |
tree | afee478d9dfca25e7abcb2bc41084adce7f8b7d3 /llvm/lib | |
parent | 1df0cf40ea8486a7855aa2924c3bb51a64037750 (diff) | |
download | bcm5719-llvm-caea64b09806a7c6500ceaf93bde4d48d22f810f.tar.gz bcm5719-llvm-caea64b09806a7c6500ceaf93bde4d48d22f810f.zip |
mcize uses of PrintRelDirective and eliminate it.
llvm-svn: 98107
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 18 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h | 2 |
3 files changed, 9 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp index 99e12e2e3e6..4f445343555 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -886,13 +886,11 @@ void DwarfException::EmitExceptionTable() { I = TypeInfos.rbegin(), E = TypeInfos.rend(); I != E; ++I) { const GlobalVariable *GV = *I; - if (GV) { - Asm->OutStreamer.AddComment("TypeInfo"); + Asm->OutStreamer.AddComment("TypeInfo"); + if (GV) EmitReference(GV, TTypeEncoding); - } else { - PrintRelDirective(TTypeEncoding); - O << "0x0\n"; - } + else + Asm->OutStreamer.EmitIntValue(0, SizeOfEncodedValue(TTypeEncoding), 0); } // Emit the Exception Specifications. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 86a1ead71d0..d69b53051ed 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -77,14 +77,6 @@ unsigned DwarfPrinter::SizeOfEncodedValue(unsigned Encoding) const { return 0; } -void DwarfPrinter::PrintRelDirective(unsigned Encoding) const { - unsigned Size = SizeOfEncodedValue(Encoding); - assert((Size == 4 || Size == 8) && "Do not support other types or rels!"); - - O << (Size == 4 ? - MAI->getData32bitsDirective() : MAI->getData64bitsDirective()); -} - static const char *DecodeDWARFEncoding(unsigned Encoding) { switch (Encoding) { case dwarf::DW_EH_PE_absptr: return "absptr"; @@ -215,16 +207,16 @@ void DwarfPrinter::EmitReference(const MCSymbol *Sym, bool IsPCRelative, void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const { const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); - PrintRelDirective(Encoding); - O << *TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding); + const MCExpr *Exp = TLOF.getSymbolForDwarfReference(Sym, Asm->MMI, Encoding); + Asm->OutStreamer.EmitValue(Exp, SizeOfEncodedValue(Encoding), /*addrspace*/0); } void DwarfPrinter::EmitReference(const GlobalValue *GV, unsigned Encoding)const{ const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering(); - PrintRelDirective(Encoding); - O << *TLOF.getSymbolForDwarfGlobalReference(GV, Asm->Mang, - Asm->MMI, Encoding); + const MCExpr *Exp = + TLOF.getSymbolForDwarfGlobalReference(GV, Asm->Mang, Asm->MMI, Encoding); + Asm->OutStreamer.EmitValue(Exp, SizeOfEncodedValue(Encoding), /*addrspace*/0); } /// EmitDifference - Emit the difference between two labels. If this assembler diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h index 0fe45e4cc30..7a2eb401839 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.h @@ -88,8 +88,6 @@ public: /// SizeOfEncodedValue - Return the size of the encoding in bytes. unsigned SizeOfEncodedValue(unsigned Encoding) const; - void PrintRelDirective(unsigned Encoding) const; - /// EmitEncodingByte - Emit a .byte 42 directive that corresponds to an /// encoding. If verbose assembly output is enabled, we output comments /// describing the encoding. Desc is a string saying what the encoding is |