diff options
-rw-r--r-- | include/llvm/CodeGen/DwarfWriter.h | 3 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/DwarfWriter.h b/include/llvm/CodeGen/DwarfWriter.h index c2ad3a6483..24b0f97dfc 100644 --- a/include/llvm/CodeGen/DwarfWriter.h +++ b/include/llvm/CodeGen/DwarfWriter.h @@ -93,6 +93,9 @@ public: /// getRecordSourceLineCount - Count source lines. unsigned getRecordSourceLineCount(); + /// hasDebugInfo - Return true if debug info intrinsics are seen in + /// this module. + bool hasDebugInfo(); }; diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 88c96baea8..d79e6aa778 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -4984,3 +4984,9 @@ unsigned DwarfWriter::RecordRegionEnd(GlobalVariable *V) { unsigned DwarfWriter::getRecordSourceLineCount() { return DD->getRecordSourceLineCount(); } + +/// hasDebugInfo - Return true if debug info intrinsics are seen in +/// this module. +bool DwarfWriter::hasDebugInfo() { + return DD && DD->ShouldEmitDwarf(); +} diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 324b07025e..65a3e07b04 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/DwarfWriter.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetData.h" @@ -2040,8 +2041,8 @@ bool SelectionDAG::isVerifiedDebugInfoDesc(SDValue Op) const { if (GA->getOffset() != 0) return false; GlobalVariable *GV = dyn_cast<GlobalVariable>(GA->getGlobal()); if (!GV) return false; - MachineModuleInfo *MMI = getMachineModuleInfo(); - return MMI && MMI->hasDebugInfo() && MMI->isVerified(GV); + DwarfWriter *DW = getDwarfWriter(); + return DW && DW->hasDebugInfo(); } |