Skip to content

Commit

Permalink
[llvm-profgen] Fix warning of enumerated and non-enumerated type in c…
Browse files Browse the repository at this point in the history
…onditional expression

Differential Revision: https://reviews.llvm.org/D115842
  • Loading branch information
wlei-llvm committed Dec 17, 2021
1 parent 319d8cf commit b239b2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/tools/llvm-profgen/PerfReader.cpp
Expand Up @@ -905,8 +905,8 @@ void PerfScriptReader::computeCounterFromLBR(const PerfSample *Sample,
"Branch' source should not be an external address, it should be "
"converted to aritificial branch.");
uint64_t SourceOffset = Binary->virtualAddrToOffset(LBR.Source);
uint64_t TargetOffset = LBR.Target == ExternalAddr
? ExternalAddr
uint64_t TargetOffset = LBR.Target == static_cast<uint64_t>(ExternalAddr)
? static_cast<uint64_t>(ExternalAddr)
: Binary->virtualAddrToOffset(LBR.Target);

if (!LBR.IsArtificial && TargetOffset != ExternalAddr) {
Expand Down

0 comments on commit b239b2b

Please sign in to comment.