[llvm-commits] [dragonegg] r137233 - /dragonegg/trunk/src/Trees.cpp

Duncan Sands baldrick at free.fr
Wed Aug 10 11:44:44 PDT 2011


Author: baldrick
Date: Wed Aug 10 13:44:44 2011
New Revision: 137233

URL: http://llvm.org/viewvc/llvm-project?rev=137233&view=rev
Log:
Be more careful about when we generate nsw/nuw flags.  Paying
attention to -fstrict_overflow like this means that they will
only be generated at -O2 and higher.

Modified:
    dragonegg/trunk/src/Trees.cpp

Modified: dragonegg/trunk/src/Trees.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Trees.cpp?rev=137233&r1=137232&r2=137233&view=diff
==============================================================================
--- dragonegg/trunk/src/Trees.cpp (original)
+++ dragonegg/trunk/src/Trees.cpp Wed Aug 10 13:44:44 2011
@@ -133,13 +133,13 @@
 /// hasNUW - Return whether overflowing unsigned operations on this type result
 /// in undefined behaviour.
 bool hasNUW(tree type) {
-  return TYPE_UNSIGNED(type) && !TYPE_OVERFLOW_WRAPS(type);
+  return TYPE_UNSIGNED(type) && TYPE_OVERFLOW_UNDEFINED(type);
 }
 
 /// hasNSW - Return whether overflowing signed operations on this type result
 /// in undefined behaviour.
 bool hasNSW(tree type) {
-  return !TYPE_UNSIGNED(type) && !TYPE_OVERFLOW_WRAPS(type);
+  return !TYPE_UNSIGNED(type) && TYPE_OVERFLOW_UNDEFINED(type);
 }
 
 /// getIntegerValue - Return the specified INTEGER_CST as an APInt.





More information about the llvm-commits mailing list