From 76ca0d67ab07929dd6d2d34327034bc87ff822a9 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 16 Oct 2021 11:02:13 +0100 Subject: [PATCH] [ConstantFolding] ConstantFoldScalarCall1 - early-out if getLibFunc fails. NFC. --- llvm/lib/Analysis/ConstantFolding.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 98d886c..8666954 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -2065,7 +2065,9 @@ static Constant *ConstantFoldScalarCall1(StringRef Name, return nullptr; LibFunc Func = NotLibFunc; - TLI->getLibFunc(Name, Func); + if (!TLI->getLibFunc(Name, Func)) + return nullptr; + switch (Func) { default: break; -- 2.7.4