From 61c6bf37ef7d6066d12efa40639d67e7caf14b2d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 16 Jan 2009 01:49:46 +0000 Subject: [PATCH] Any debug info symbol is only valid if atleast one compile unit is seen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62294 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 4f115b1204f..5e98618b243 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -3083,6 +3083,10 @@ public: /// ValidDebugInfo - Return true if V represents valid debug info value. bool ValidDebugInfo(Value *V) { + + if (!shouldEmit) + return false; + GlobalVariable *GV = getGlobalVariable(V); if (!GV) return false;