From 4ec4089b302d4ab2ec3deac089c7834d27aa39ee Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 9 Dec 2011 06:47:34 +0000 Subject: [PATCH] Teach isConstantInitializer that numeric literals are constants, rather than having it evaluate them. No change in functionality, but a speed up of about 5% on some translation units in SPEC 445.gobmk. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146248 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Expr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 08611c32c6..40da32284d 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -2466,6 +2466,8 @@ bool Expr::isConstantInitializer(ASTContext &Ctx, bool IsForRef) const { switch (getStmtClass()) { default: break; + case IntegerLiteralClass: + case FloatingLiteralClass: case StringLiteralClass: case ObjCStringLiteralClass: case ObjCEncodeExprClass: -- 2.50.1