summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp11
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