[llvm] r255461 - Fix a type issue in r255455. Should not use unsigned type as std::abs()'s template type.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 13 09:00:25 PST 2015


Author: conghou
Date: Sun Dec 13 11:00:25 2015
New Revision: 255461

URL: http://llvm.org/viewvc/llvm-project?rev=255461&view=rev
Log:
Fix a type issue in r255455. Should not use unsigned type as std::abs()'s template type.

Modified:
    llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp

Modified: llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp?rev=255461&r1=255460&r2=255461&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineBasicBlock.cpp Sun Dec 13 11:00:25 2015
@@ -515,7 +515,7 @@ void MachineBasicBlock::validateSuccProb
   // Due to precision issue, we assume that the sum of probabilities is one if
   // the difference between the sum of their numerators and the denominator is
   // no greater than the number of successors.
-  assert(std::abs<uint64_t>(Sum - BranchProbability::getDenominator()) <=
+  assert((uint64_t)std::abs(Sum - BranchProbability::getDenominator()) <=
              Probs.size() &&
          "The sum of successors's probabilities exceeds one.");
 #endif // NDEBUG




More information about the llvm-commits mailing list