diff options
author | wlei <wlei@fb.com> | 2021-12-15 19:14:50 -0800 |
---|---|---|
committer | wlei <wlei@fb.com> | 2021-12-16 19:28:55 -0800 |
commit | b239b2b0db72a6c05fb713f282d22a3539281a08 (patch) | |
tree | 50736b695468d65825e8094b72b6fd6a64ceab2f /llvm/tools/llvm-profgen/PerfReader.cpp | |
parent | 319d8cf685f26293b25aa0a8962c67355565714f (diff) | |
download | llvm-b239b2b0db72a6c05fb713f282d22a3539281a08.zip llvm-b239b2b0db72a6c05fb713f282d22a3539281a08.tar.gz llvm-b239b2b0db72a6c05fb713f282d22a3539281a08.tar.bz2 |
[llvm-profgen] Fix warning of enumerated and non-enumerated type in conditional expression
Differential Revision: https://reviews.llvm.org/D115842
Diffstat (limited to 'llvm/tools/llvm-profgen/PerfReader.cpp')
-rw-r--r-- | llvm/tools/llvm-profgen/PerfReader.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp index c8edc9b..46422ce 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) { |