r234245 - DebugInfo: Use DILexicalBlockFile::getContext() over getScope()

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Apr 6 15:04:18 PDT 2015


Author: dexonsmith
Date: Mon Apr  6 17:04:18 2015
New Revision: 234245

URL: http://llvm.org/viewvc/llvm-project?rev=234245&view=rev
Log:
DebugInfo: Use DILexicalBlockFile::getContext() over getScope()

`getScope()` passes the scope back through a `DILexicalBlock` even
though the underlying pointer may be an incompatible `MDSubprogram`.
Just use `getContext()` directly.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=234245&r1=234244&r2=234245&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Apr  6 17:04:18 2015
@@ -129,7 +129,7 @@ void CGDebugInfo::setLocation(SourceLoca
   if (Scope.isLexicalBlockFile()) {
     llvm::DILexicalBlockFile LBF = llvm::DILexicalBlockFile(Scope);
     llvm::DIDescriptor D = DBuilder.createLexicalBlockFile(
-        LBF.getScope(), getOrCreateFile(CurLoc));
+        LBF.getContext(), getOrCreateFile(CurLoc));
     llvm::MDNode *N = D;
     LexicalBlockStack.pop_back();
     LexicalBlockStack.emplace_back(N);





More information about the cfe-commits mailing list