mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-16 18:30:52 +00:00
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
llvm-svn: 234693
This commit is contained in:
parent
9ea802df93
commit
00851732f5
@ -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…
x
Reference in New Issue
Block a user