Skip to content

Commit f71f23d

Browse files
committed
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
1 parent aae97bf commit f71f23d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Utils/FunctionImportUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ void FunctionImportGlobalProcessing::processGlobalForThinLTO(GlobalValue &GV) {
210210
if (Function *F = dyn_cast<Function>(&GV)) {
211211
if (!F->isDeclaration()) {
212212
for (auto &S : VI.getSummaryList()) {
213-
FunctionSummary *FS = dyn_cast<FunctionSummary>(S->getBaseObject());
213+
auto *FS = cast<FunctionSummary>(S->getBaseObject());
214214
if (FS->modulePath() == M.getModuleIdentifier()) {
215215
F->setEntryCount(Function::ProfileCount(FS->entryCount(),
216216
Function::PCT_Synthetic));

0 commit comments

Comments
 (0)