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.

llvm-svn: 57160
This commit is contained in:
Chris Lattner 2008-10-06 06:51:12 +00:00
parent cb13691a62
commit b7c86a211c
2 changed files with 9 additions and 16 deletions

View File

@ -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_bswap32, "UiUi", "nc")
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")

View File

@ -78,12 +78,6 @@ public:
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 {