From: Richard Smith Date: Fri, 9 Dec 2011 06:47:34 +0000 (+0000) Subject: Teach isConstantInitializer that numeric literals are constants, rather than X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ec4089b302d4ab2ec3deac089c7834d27aa39ee;p=clang 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 --- 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: