diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-05-10 18:52:16 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-05-10 18:52:16 +0000 |
commit | 94624aca2ab44a385ba154c72ecb8df3bba6ea62 (patch) | |
tree | ec1c9813618448a2bf54be675daa8ad0f19907c8 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | ecb97da1081225c0014177db63ec1f698d597c68 (diff) | |
download | llvm-94624aca2ab44a385ba154c72ecb8df3bba6ea62.zip llvm-94624aca2ab44a385ba154c72ecb8df3bba6ea62.tar.gz llvm-94624aca2ab44a385ba154c72ecb8df3bba6ea62.tar.bz2 |
Ensure non-null ProfileSummaryInfo passed to ModuleSummaryIndex builder
This fixes a ubsan bot failure after r302597, which made getProfileCount
non-static, but ended up invoking it on a null ProfileSummaryInfo object
in some cases from buildModuleSummaryIndex.
Most testing passed because the non-static getProfileCount currently
doesn't access any member variables, but I found this when testing a
follow on patch (D32877) that adds a member variable access.
llvm-svn: 302705
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 6c207f8..26706f5 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -330,6 +330,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex( const Module &M, std::function<BlockFrequencyInfo *(const Function &F)> GetBFICallback, ProfileSummaryInfo *PSI) { + assert(PSI); ModuleSummaryIndex Index; // Identify the local values in the llvm.used and llvm.compiler.used sets, |