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

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 19:39:14 PST 2021


wlei updated this revision to Diff 394729.
wlei added a comment.

Updating D115842 <https://reviews.llvm.org/D115842>: [llvm-profgen] Fix warning of enumerated and non-enumerated type in conditional expression


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115842/new/

https://reviews.llvm.org/D115842

Files:
  llvm/tools/llvm-profgen/PerfReader.cpp


Index: llvm/tools/llvm-profgen/PerfReader.cpp
===================================================================
--- llvm/tools/llvm-profgen/PerfReader.cpp
+++ llvm/tools/llvm-profgen/PerfReader.cpp
@@ -905,8 +905,8 @@
            "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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115842.394729.patch
Type: text/x-patch
Size: 811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/bb3311c8/attachment.bin>


More information about the llvm-commits mailing list