Revert the revert 253497 and 253539 - These commits aren't the cause of the clang...
[oota-llvm.git] / include / llvm / ProfileData / InstrProf.h
index 59d0e1877a6909ff52ac6b9f60b0f71cc9e772be..c31f4b5b589bd09d10ee684226eb60b89208f47b 100644 (file)
@@ -226,7 +226,7 @@ struct InstrProfValueSiteRecord {
       while (I != IE && I->Value < J->Value)
         ++I;
       if (I != IE && I->Value == J->Value) {
-        I->Count += J->Count;
+        I->Count = SaturatingAdd(I->Count, J->Count);
         ++I;
         continue;
       }