[llvm-commits] [llvm] r79401 - /llvm/trunk/include/llvm/CodeGen/ValueTypes.h

Erick Tryzelaar idadesub at users.sourceforge.net
Tue Aug 18 19:53:07 PDT 2009


Author: erickt
Date: Tue Aug 18 21:53:07 2009
New Revision: 79401

URL: http://llvm.org/viewvc/llvm-project?rev=79401&view=rev
Log:
Fix gcc-4.4/fedora 11 by adding a sentinel value to SimpleValueType.

gcc-4.4 was optimizing away comparisons against SimpleValueType when
it was compared to a value larger than the largest value in the enum.
This patch works around it by adding one extra item to the enum so
that these tests will now be valid.

Modified:
    llvm/trunk/include/llvm/CodeGen/ValueTypes.h

Modified: llvm/trunk/include/llvm/CodeGen/ValueTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ValueTypes.h?rev=79401&r1=79400&r2=79401&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ValueTypes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ValueTypes.h Tue Aug 18 21:53:07 2009
@@ -111,7 +111,12 @@
       iPTR           = 255,
 
       // LastSimpleValueType - The greatest valid SimpleValueType value.
-      LastSimpleValueType = 255
+      LastSimpleValueType = 255,
+
+      // FirstExtendedValueType - This sentinel is needed so that gcc 4.4 won't
+      // optimize away checks of a SimpleValueType compared to
+      // LastSimpleValueType+1.
+      FirstExtendedValueType = 256
     };
 
     SimpleValueType SimpleTy;





More information about the llvm-commits mailing list