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

Bill Wendling wendling at apple.com
Wed Aug 19 11:44:55 PDT 2009


On Aug 18, 2009, at 7:53 PM, Erick Tryzelaar wrote:

> 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.
>
Hi Erick,

Why did you choose the name "FirstExtendedValueType"? If it's a  
sentinel, maybe just name it so...

-bw

> 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;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list