diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-27 15:49:19 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-27 15:49:19 +0000 |
commit | f71f23d14d4353f823ddf93680ddac86e95819d7 (patch) | |
tree | 26b8637a80f4db36c73323a7f047788b1868fdb2 /llvm/lib/Transforms/Utils | |
parent | aae97bfd0c323edef5363ce296c9f6f79db410cf (diff) | |
download | bcm5719-llvm-f71f23d14d4353f823ddf93680ddac86e95819d7.tar.gz bcm5719-llvm-f71f23d14d4353f823ddf93680ddac86e95819d7.zip |
FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer dyn_cast<FunctionSummary> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<FunctionSummary> directly and if not assert will fire for us.
llvm-svn: 373097
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/FunctionImportUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp index c9cc0990f23..76b4635ad50 100644 --- a/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp +++ b/llvm/lib/Transforms/Utils/FunctionImportUtils.cpp @@ -210,7 +210,7 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) { if (Function *F = dyn_cast<Function>(&GV)) { if (!F->isDeclaration()) { for (auto &S : VI.getSummaryList()) { - FunctionSummary *FS = dyn_cast<FunctionSummary>(S->getBaseObject()); + auto *FS = cast<FunctionSummary>(S->getBaseObject()); if (FS->modulePath() == M.getModuleIdentifier()) { F->setEntryCount(Function::ProfileCount(FS->entryCount(), Function::PCT_Synthetic)); |