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;