]> granicus.if.org Git - clang/commitdiff
Teach isConstantInitializer that numeric literals are constants, rather than
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Dec 2011 06:47:34 +0000 (06:47 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Dec 2011 06:47:34 +0000 (06:47 +0000)
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

index 08611c32c692b8c47d2b216c8cae3ceccdbc0833..40da32284dfb07247578cfc034dfad3f5ea3573a 100644 (file)
@@ -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: