From: Simon Pilgrim Date: Fri, 27 Sep 2019 15:49:19 +0000 (+0000) Subject: FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51c6eb1c5a5b1cb3f97d925a7fc4523c75411658;p=llvm FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer dyn_cast null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast directly and if not assert will fire for us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373097 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/FunctionImportUtils.cpp b/lib/Transforms/Utils/FunctionImportUtils.cpp index c9cc0990f23..76b4635ad50 100644 --- a/lib/Transforms/Utils/FunctionImportUtils.cpp +++ b/lib/Transforms/Utils/FunctionImportUtils.cpp @@ -210,7 +210,7 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) { if (Function *F = dyn_cast(&GV)) { if (!F->isDeclaration()) { for (auto &S : VI.getSummaryList()) { - FunctionSummary *FS = dyn_cast(S->getBaseObject()); + auto *FS = cast(S->getBaseObject()); if (FS->modulePath() == M.getModuleIdentifier()) { F->setEntryCount(Function::ProfileCount(FS->entryCount(), Function::PCT_Synthetic));