SampleProfileLoader::inlineHotFunctionsWithPriority - Fix uninitialized variable warning. NFCI.

findIndirectCallFunctionSamples will leave Sum uninitialized if it returns an empty vector, we don't really use Sum in this case (but we do make a copy that isn't used either) - so ensure we initialize the value to zero to at least silence the static analysis warning.
This commit is contained in:
Simon Pilgrim 2021-05-15 15:02:52 +01:00
parent c5fe383990
commit e30540a603
1 changed files with 1 additions and 1 deletions

View File

@ -1345,7 +1345,7 @@ bool SampleProfileLoader::inlineHotFunctionsWithPriority(
if (CalledFunction == &F)
continue;
if (I->isIndirectCall()) {
uint64_t Sum;
uint64_t Sum = 0;
auto CalleeSamples = findIndirectCallFunctionSamples(*I, Sum);
uint64_t SumOrigin = Sum;
Sum *= Candidate.CallsiteDistribution;