aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ExprConstant.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index aa949907eb..f2e3d36d75 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -3391,6 +3391,12 @@ static bool EvaluateConstantExpression(APValue &Result, EvalInfo &Info,
/// in Result. If this expression is a glvalue, an lvalue-to-rvalue conversion
/// will be applied to the result.
bool Expr::EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx) const {
+ // FIXME: Evaluating initializers for large arrays can cause performance
+ // problems, and we don't use such values yet. Once we have a more efficient
+ // array representation, this should be reinstated, and used by CodeGen.
+ if (isRValue() && getType()->isArrayType())
+ return false;
+
EvalInfo Info(Ctx, Result);
CCValue Value;