summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp5
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;
}
OpenPOWER on IntegriCloud