forked from OSchip/llvm-project
DebugInfo: Rewrite llvm::getDISubprogram(), NFC
Simplify implementation of `llvm::getDISubprogram()`. I might go through and see how difficult it is to update the users, since this function doesn't really seem necessary anymore. llvm-svn: 233662
This commit is contained in:
parent
3b960c9da0
commit
dd77af870f
|
@ -461,17 +461,9 @@ DIVariable llvm::cleanseInlinedVariable(MDNode *DV, LLVMContext &VMContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DISubprogram llvm::getDISubprogram(const MDNode *Scope) {
|
DISubprogram llvm::getDISubprogram(const MDNode *Scope) {
|
||||||
DIDescriptor D(Scope);
|
if (auto *LocalScope = dyn_cast_or_null<MDLocalScope>(Scope))
|
||||||
if (D.isSubprogram())
|
return LocalScope->getSubprogram();
|
||||||
return DISubprogram(Scope);
|
return nullptr;
|
||||||
|
|
||||||
if (D.isLexicalBlockFile())
|
|
||||||
return getDISubprogram(DILexicalBlockFile(Scope).getContext());
|
|
||||||
|
|
||||||
if (D.isLexicalBlock())
|
|
||||||
return getDISubprogram(DILexicalBlock(Scope).getContext());
|
|
||||||
|
|
||||||
return DISubprogram();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DISubprogram llvm::getDISubprogram(const Function *F) {
|
DISubprogram llvm::getDISubprogram(const Function *F) {
|
||||||
|
|
Loading…
Reference in New Issue