diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-11 18:15:48 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-11 18:15:48 +0000 |
commit | 19f87726d516959d47c4b55348552e73c2aa6821 (patch) | |
tree | af071dfb50ec6f31c504d57f8581f5209c7bf31c /llvm/lib/IR/DebugInfo.cpp | |
parent | 30bfab3cb4cc6eba263ea3d3b9624f8b7289d9c9 (diff) | |
download | llvm-19f87726d516959d47c4b55348552e73c2aa6821.zip llvm-19f87726d516959d47c4b55348552e73c2aa6821.tar.gz llvm-19f87726d516959d47c4b55348552e73c2aa6821.tar.bz2 |
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
llvm-svn: 234693
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 6845827..c8ae263 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -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; } |