Skip to content

Commit

Permalink
Fix UB found by -Wtautological-undefined-compare
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298279 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Mar 20, 2017
1 parent 56d588a commit 1f1cffb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Transforms/Utils/InlineFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,10 +1439,9 @@ static void updateCallProfile(Function *Callee, const ValueToValueMapTy &VMap,
CalleeEntryCount.getValue());

for (auto const &Entry : VMap)
if (isa<CallInst>(Entry.first) && &*Entry.second != nullptr &&
isa<CallInst>(Entry.second))
cast<CallInst>(Entry.second)
->updateProfWeight(CallCount, CalleeEntryCount.getValue());
if (isa<CallInst>(Entry.first))
if (auto *CI = dyn_cast_or_null<CallInst>(Entry.second))
CI->updateProfWeight(CallCount, CalleeEntryCount.getValue());
for (BasicBlock &BB : *Callee)
// No need to update the callsite if it is pruned during inlining.
if (VMap.count(&BB))
Expand Down

0 comments on commit 1f1cffb

Please sign in to comment.