From: Duncan P. N. Exon Smith Date: Sat, 11 Apr 2015 18:15:48 +0000 (+0000) Subject: DebugInfo: Assume a valid pointer for DISubprogram::getFunction() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7ba137f94b3ca2f7a63cd30b785d6d73f794b7f1;p=oota-llvm.git DebugInfo: Assume a valid pointer for DISubprogram::getFunction() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234693 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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; }