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 | |
| parent | 30bfab3cb4cc6eba263ea3d3b9624f8b7289d9c9 (diff) | |
| download | bcm5719-llvm-19f87726d516959d47c4b55348552e73c2aa6821.tar.gz bcm5719-llvm-19f87726d516959d47c4b55348552e73c2aa6821.zip | |
DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
llvm-svn: 234693
Diffstat (limited to 'llvm/lib')
| -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 6845827fc24..c8ae2639161 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; } |

