summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-08-31 00:14:07 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-08-31 00:14:07 +0000
commit34866c7719f893c957d93f5918f760b6edebd6be (patch)
tree99993f8a0fe6978857272dddd3dfe01dd77f876c /clang/lib/AST/ExprConstant.cpp
parent98cfa1044fdcaaa53625c16bb9a246e0b15f7653 (diff)
downloadbcm5719-llvm-34866c7719f893c957d93f5918f760b6edebd6be.tar.gz
bcm5719-llvm-34866c7719f893c957d93f5918f760b6edebd6be.zip
Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r--clang/lib/AST/ExprConstant.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index fb0c4d26ea8..2cd7f04e927 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -5357,6 +5357,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
case CK_IntegralRealToComplex:
case CK_IntegralComplexCast:
case CK_IntegralComplexToFloatingComplex:
+ case CK_BuiltinFnToFnPtr:
llvm_unreachable("invalid cast kind for integral value");
case CK_BitCast:
@@ -5843,6 +5844,7 @@ bool ComplexExprEvaluator::VisitCastExpr(const CastExpr *E) {
case CK_ARCReclaimReturnedObject:
case CK_ARCExtendBlockObject:
case CK_CopyAndAutoreleaseBlockObject:
+ case CK_BuiltinFnToFnPtr:
llvm_unreachable("invalid cast kind for complex value");
case CK_LValueToRValue:
OpenPOWER on IntegriCloud