[llvm] b239b2b - [llvm-profgen] Fix warning of enumerated and non-enumerated type in conditional expression
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 16 19:29:44 PST 2021
Author: wlei
Date: 2021-12-16T19:28:55-08:00
New Revision: b239b2b0db72a6c05fb713f282d22a3539281a08
URL: https://github.com/llvm/llvm-project/commit/b239b2b0db72a6c05fb713f282d22a3539281a08
DIFF: https://github.com/llvm/llvm-project/commit/b239b2b0db72a6c05fb713f282d22a3539281a08.diff
LOG: [llvm-profgen] Fix warning of enumerated and non-enumerated type in conditional expression
Differential Revision: https://reviews.llvm.org/D115842
Added:
Modified:
llvm/tools/llvm-profgen/PerfReader.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index c8edc9bea8578..46422ce470898 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -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) {
More information about the llvm-commits
mailing list