diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp index 74481b0e501f..6f3da0245c13 100644 --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -178,7 +178,8 @@ void PMDataManager::emitInstrCountChangedRemark(Pass *P, Module &M, // Compute a possibly negative delta between the instruction count before // running P, and after running P. - int64_t Delta = (int64_t)CountAfter - (int64_t)CountBefore; + int64_t Delta = + static_cast(CountAfter) - static_cast(CountBefore); BasicBlock &BB = *F->begin(); OptimizationRemarkAnalysis R("size-info", "IRSizeChange",