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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user