diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 03:24:14 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-14 03:24:14 +0000 |
commit | 87afdeb8f56c4c71a8d121d87bda7955460e67b4 (patch) | |
tree | 060c198e0400fdbc41fcd9b99256451c31b5fd7c | |
parent | b96610410f7397bd7a66a8d863f0038c6b8614b3 (diff) | |
download | bcm5719-llvm-87afdeb8f56c4c71a8d121d87bda7955460e67b4.tar.gz bcm5719-llvm-87afdeb8f56c4c71a8d121d87bda7955460e67b4.zip |
DebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted
An upcoming LLVM commit will remove this API, so stop using it. Just
access the raw pointers using `operator->()`.
llvm-svn: 234848
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index e2bbb6d427c..992d61eaea2 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -126,10 +126,9 @@ void CGDebugInfo::setLocation(SourceLocation Loc) { if (PCLoc.isInvalid() || Scope.getFilename() == PCLoc.getFilename()) return; - if (llvm::DILexicalBlockFile LBF = - dyn_cast<llvm::MDLexicalBlockFile>(Scope)) { + if (auto *LBF = dyn_cast<llvm::MDLexicalBlockFile>(Scope)) { llvm::DIDescriptor D = DBuilder.createLexicalBlockFile( - LBF.getContext(), getOrCreateFile(CurLoc)); + LBF->getScope(), getOrCreateFile(CurLoc)); llvm::MDNode *N = D; LexicalBlockStack.pop_back(); LexicalBlockStack.emplace_back(N); @@ -2500,16 +2499,16 @@ llvm::DISubprogram CGDebugInfo::getFunctionDeclaration(const Decl *D) { } } if (MI != SPCache.end()) { - llvm::DISubprogram SP = dyn_cast_or_null<llvm::MDSubprogram>(MI->second); - if (SP && !SP.isDefinition()) + auto *SP = dyn_cast_or_null<llvm::MDSubprogram>(MI->second); + if (SP && !SP->isDefinition()) return SP; } for (auto NextFD : FD->redecls()) { auto MI = SPCache.find(NextFD->getCanonicalDecl()); if (MI != SPCache.end()) { - llvm::DISubprogram SP = dyn_cast_or_null<llvm::MDSubprogram>(MI->second); - if (SP && !SP.isDefinition()) + auto *SP = dyn_cast_or_null<llvm::MDSubprogram>(MI->second); + if (SP && !SP->isDefinition()) return SP; } } @@ -2603,8 +2602,8 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, SourceLocation Loc, // If there is a DISubprogram for this function available then use it. auto FI = SPCache.find(FD->getCanonicalDecl()); if (FI != SPCache.end()) { - llvm::DISubprogram SP = dyn_cast_or_null<llvm::MDSubprogram>(FI->second); - if (SP && SP.isDefinition()) { + auto *SP = dyn_cast_or_null<llvm::MDSubprogram>(FI->second); + if (SP && SP->isDefinition()) { llvm::MDNode *SPN = SP; LexicalBlockStack.emplace_back(SPN); RegionMap[D].reset(SP); |