]> granicus.if.org Git - clang/commitdiff
DebugInfo: Use DILexicalBlockFile::getContext() over getScope()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:04:18 +0000 (22:04 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 6 Apr 2015 22:04:18 +0000 (22:04 +0000)
`getScope()` passes the scope back through a `DILexicalBlock` even
though the underlying pointer may be an incompatible `MDSubprogram`.
Just use `getContext()` directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234245 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 811486cf3ab9e7d1fc0d5a14310c36f19208662a..6e9533c7e7a0cb57cfe08ced0f6e4c597f02e402 100644 (file)
@@ -129,7 +129,7 @@ void CGDebugInfo::setLocation(SourceLocation Loc) {
   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);