diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2012-11-19 21:17:20 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2012-11-19 21:17:20 +0000 |
commit | 239938ff77ef43c753881b030438f89a3dfc72c4 (patch) | |
tree | f9f2cb47d3b44cd1ce22e1550dd846b0aed721bf /lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | |
parent | 2386fc8daa682c7b6c2479cd9c9c3113581c41db (diff) |
Make AsmPrinter::EmitTTypeReference() more robust - put
the zero GV check inside, so we won't forget it at the caller side.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp index b214f5a5b2..e88a766323 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp @@ -120,11 +120,14 @@ unsigned AsmPrinter::GetSizeOfEncodedValue(unsigned Encoding) const { } void AsmPrinter::EmitTTypeReference(const GlobalValue *GV, unsigned Encoding)const{ - const TargetLoweringObjectFile &TLOF = getObjFileLowering(); + if (GV) { + const TargetLoweringObjectFile &TLOF = getObjFileLowering(); - const MCExpr *Exp = - TLOF.getTTypeGlobalReference(GV, Mang, MMI, Encoding, OutStreamer); - OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding), /*addrspace*/0); + const MCExpr *Exp = + TLOF.getTTypeGlobalReference(GV, Mang, MMI, Encoding, OutStreamer); + OutStreamer.EmitValue(Exp, GetSizeOfEncodedValue(Encoding), /*addrspace*/0); + } else + OutStreamer.EmitIntValue(0, GetSizeOfEncodedValue(Encoding), 0); } /// EmitSectionOffset - Emit the 4-byte offset of Label from the start of its |