Temporary fix for a performance problem Eli spotted. The APValue representation

is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.

llvm-svn: 144260
This commit is contained in:
Richard Smith 2011-11-10 03:30:42 +00:00
parent 16d2320c97
commit 5686e75a7b
1 changed files with 6 additions and 0 deletions

View File

@ -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;