mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-07 12:30:57 +00:00
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234693 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
38ebdeea7a
commit
7ba137f94b
@ -90,9 +90,8 @@ bool DIVariable::isInlinedFnArgument(const Function *CurFn) {
|
||||
}
|
||||
|
||||
Function *DISubprogram::getFunction() const {
|
||||
if (auto *N = get())
|
||||
if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(N->getFunction()))
|
||||
return dyn_cast<Function>(C->getValue());
|
||||
if (auto *C = dyn_cast_or_null<ConstantAsMetadata>(get()->getFunction()))
|
||||
return dyn_cast<Function>(C->getValue());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user