From eed6a11f81db8a86b3630a5e90fb072d99368f8d Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Mon, 13 Apr 2015 19:41:30 +0000 Subject: [PATCH] DebugInfo: Assume valid pointer in DISubprogram::replaceFunction() Other accessors assume this already; not sure how `replaceFunction()` got left behind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234782 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index f4f6bd3ecde..69eacc7b8b1 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -524,10 +524,7 @@ public: Function *getFunction() const { return get()->getFunction(); } - void replaceFunction(Function *F) { - if (auto *N = get()) - N->replaceFunction(F); - } + void replaceFunction(Function *F) { get()->replaceFunction(F); } DIArray getTemplateParams() const { return DIArray(get()->getTemplateParams()); } -- 2.34.1