diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp --- a/llvm/tools/llvm-profgen/PerfReader.cpp +++ b/llvm/tools/llvm-profgen/PerfReader.cpp @@ -9,6 +9,7 @@ #include "ProfileGenerator.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Process.h" +#include #define DEBUG_TYPE "perf-reader" @@ -905,8 +906,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(ExternalAddr) + ? static_cast(ExternalAddr) : Binary->virtualAddrToOffset(LBR.Target); if (!LBR.IsArtificial && TargetOffset != ExternalAddr) {