[cfe-commits] r57160 - in /cfe/trunk/include/clang/AST: Builtins.def Builtins.h

Chris Lattner sabre at nondot.org
Sun Oct 5 23:51:12 PDT 2008


Author: lattner
Date: Mon Oct  6 01:51:12 2008
New Revision: 57160

URL: http://llvm.org/viewvc/llvm-project?rev=57160&view=rev
Log:
Remove the 'C' / isConstantExpr flag on builtins.  Code should never
depend on the value of this flag, it should depend on whether 
tryEvaluate is able to *actually* fold a builtin.

Modified:
    cfe/trunk/include/clang/AST/Builtins.def
    cfe/trunk/include/clang/AST/Builtins.h

Modified: cfe/trunk/include/clang/AST/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Builtins.def?rev=57160&r1=57159&r2=57160&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Builtins.def (original)
+++ cfe/trunk/include/clang/AST/Builtins.def Mon Oct  6 01:51:12 2008
@@ -52,16 +52,15 @@
 //  n -> nothrow
 //  c -> const
 //  F -> this is a libc/libm function with a '__builtin_' prefix added.
-//  C -> this builtin can be used as a "constant expression"
 //  FIXME: gcc has nonnull
 
 // Standard libc/libm functions:
-BUILTIN(__builtin_huge_val, "d", "ncC")
-BUILTIN(__builtin_huge_valf, "f", "ncC")
-BUILTIN(__builtin_huge_vall, "Ld", "ncC")
-BUILTIN(__builtin_inf  , "d"   , "ncC")
-BUILTIN(__builtin_inff , "f"   , "ncC")
-BUILTIN(__builtin_infl , "Ld"  , "ncC")
+BUILTIN(__builtin_huge_val, "d", "nc")
+BUILTIN(__builtin_huge_valf, "f", "nc")
+BUILTIN(__builtin_huge_vall, "Ld", "nc")
+BUILTIN(__builtin_inf  , "d"   , "nc")
+BUILTIN(__builtin_inff , "f"   , "nc")
+BUILTIN(__builtin_infl , "Ld"  , "nc")
 BUILTIN(__builtin_nan,  "dcC*" , "ncF")
 BUILTIN(__builtin_nanf, "fcC*" , "ncF")
 BUILTIN(__builtin_nanl, "LdcC*", "ncF")
@@ -112,9 +111,9 @@
 BUILTIN(__builtin_bswap64, "ULLiULLi", "nc")
 
 // Random GCC builtins
-BUILTIN(__builtin_constant_p, "UsUs", "ncC")
-BUILTIN(__builtin_classify_type, "i.", "ncC")
-BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "ncC")
+BUILTIN(__builtin_constant_p, "UsUs", "nc")
+BUILTIN(__builtin_classify_type, "i.", "nc")
+BUILTIN(__builtin___CFStringMakeConstantString, "FC*cC*", "nc")
 BUILTIN(__builtin_va_start, "va&.", "n")
 BUILTIN(__builtin_va_end, "va&", "n")
 BUILTIN(__builtin_va_copy, "va&a", "n")

Modified: cfe/trunk/include/clang/AST/Builtins.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Builtins.h?rev=57160&r1=57159&r2=57160&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Builtins.h (original)
+++ cfe/trunk/include/clang/AST/Builtins.h Mon Oct  6 01:51:12 2008
@@ -78,12 +78,6 @@
     return strchr(GetRecord(ID).Attributes, 'F') != 0;
   }
   
-  /// isConstantExpr - Return true if this builtin can be used where a
-  /// constant expression is required.
-  bool isConstantExpr(unsigned ID) const {
-    return strchr(GetRecord(ID).Attributes, 'C') != 0;
-  }
-  
   /// hasVAListUse - Return true of the specified builtin uses __builtin_va_list
   /// as an operand or return type.
   bool hasVAListUse(unsigned ID) const {





More information about the cfe-commits mailing list