[llvm-profgen] Fix warning of enumerated and non-enumerated type in conditional expression

Differential Revision: https://reviews.llvm.org/D115842
This commit is contained in:
wlei 2021-12-15 19:14:50 -08:00
parent 319d8cf685
commit b239b2b0db
1 changed files with 2 additions and 2 deletions

View File

@ -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) {