diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-13 17:35:35 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-13 17:35:35 +0000 |
commit | 549e81f7de7ee85032e51f5445eaf7588d8e50d8 (patch) | |
tree | 4d43b7767097d5c2da7bc41dba8e38cb1c41cc94 /lib/Analysis/DebugInfo.cpp | |
parent | 5361cd2c7d2cd83ac3668bb553a4e63c282d05a2 (diff) |
"there is not any instruction with attached debug info in this module" does not mean "there is no debug info in this module". :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 81d0ddb6f5..7bb7e9b4af 100644 --- a/lib/Analysis/DebugInfo.cpp +++ b/lib/Analysis/DebugInfo.cpp @@ -969,8 +969,6 @@ void DebugInfoFinder::processModule(Module &M) { #ifdef ATTACH_DEBUG_INFO_TO_AN_INSN MetadataContext &TheMetadata = M.getContext().getMetadata(); unsigned MDDbgKind = TheMetadata.getMDKind("dbg"); - if (!MDDbgKind) - return; #endif for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI) @@ -987,15 +985,17 @@ void DebugInfoFinder::processModule(Module &M) { else if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) processDeclare(DDI); #ifdef ATTACH_DEBUG_INFO_TO_AN_INSN - else if (MDNode *L = TheMetadata.getMD(MDDbgKind, BI)) { - DILocation Loc(L); - DIScope S(Loc.getScope().getNode()); - if (S.isCompileUnit()) - addCompileUnit(DICompileUnit(S.getNode())); - else if (S.isSubprogram()) - processSubprogram(DISubprogram(S.getNode())); - else if (S.isLexicalBlock()) - processLexicalBlock(DILexicalBlock(S.getNode())); + else if (MDDbgKind) { + if (MDNode *L = TheMetadata.getMD(MDDbgKind, BI)) { + DILocation Loc(L); + DIScope S(Loc.getScope().getNode()); + if (S.isCompileUnit()) + addCompileUnit(DICompileUnit(S.getNode())); + else if (S.isSubprogram()) + processSubprogram(DISubprogram(S.getNode())); + else if (S.isLexicalBlock()) + processLexicalBlock(DILexicalBlock(S.getNode())); + } } #endif } |