1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

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
This commit is contained in:
Simon Pilgrim 2019-09-27 15:49:19 +00:00
parent bc3e25486a
commit 763eac1a90

View File

@ -210,7 +210,7 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
if (Function *F = dyn_cast<Function>(&GV)) { if (Function *F = dyn_cast<Function>(&GV)) {
if (!F->isDeclaration()) { if (!F->isDeclaration()) {
for (auto &S : VI.getSummaryList()) { for (auto &S : VI.getSummaryList()) {
FunctionSummary *FS = dyn_cast<FunctionSummary>(S->getBaseObject()); auto *FS = cast<FunctionSummary>(S->getBaseObject());
if (FS->modulePath() == M.getModuleIdentifier()) { if (FS->modulePath() == M.getModuleIdentifier()) {
F->setEntryCount(Function::ProfileCount(FS->entryCount(), F->setEntryCount(Function::ProfileCount(FS->entryCount(),
Function::PCT_Synthetic)); Function::PCT_Synthetic));