diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 6845827fc24..c8ae2639161 100644 --- a/lib/IR/DebugInfo.cpp +++ b/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(N->getFunction())) - return dyn_cast(C->getValue()); + if (auto *C = dyn_cast_or_null(get()->getFunction())) + return dyn_cast(C->getValue()); return nullptr; }