r198677 - Fix a -Wparentheses warning from GCC that caught a badly formed assert.

Chandler Carruth chandlerc at gmail.com
Mon Jan 6 22:52:13 PST 2014


Author: chandlerc
Date: Tue Jan  7 00:52:12 2014
New Revision: 198677

URL: http://llvm.org/viewvc/llvm-project?rev=198677&view=rev
Log:
Fix a -Wparentheses warning from GCC that caught a badly formed assert.

I have no idea why Clang's warning doesn't fire here, looks like a Clang
bug. I'll investigate that separately.

Modified:
    cfe/trunk/lib/CodeGen/CodeGenPGO.h

Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.h?rev=198677&r1=198676&r2=198677&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.h Tue Jan  7 00:52:12 2014
@@ -149,7 +149,7 @@ public:
   /// within the region. The adjusted count, then, is the value of the counter
   /// at the end of the region.
   uint64_t getAdjustedCount() const {
-    assert(Adjust > 0 || (uint64_t)(-Adjust) <= Count && "Negative count");
+    assert((Adjust > 0 || (uint64_t)(-Adjust) <= Count) && "Negative count");
     return Count + Adjust;
   }
   /// Get the value of the counter in this region's parent, ie, the region that





More information about the cfe-commits mailing list