From 7ba137f94b3ca2f7a63cd30b785d6d73f794b7f1 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 11 Apr 2015 18:15:48 +0000 Subject: [PATCH] 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 --- lib/IR/DebugInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; } -- 2.11.0