aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Expr.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-12-09 06:47:34 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-12-09 06:47:34 +0000
commit4ec4089b302d4ab2ec3deac089c7834d27aa39ee (patch)
tree62a578720e57aac555097873719e5df8f5884a21 /lib/AST/Expr.cpp
parentd4e6e7e4a8c1f64162e14220579abab53e0ca10c (diff)
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
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r--lib/AST/Expr.cpp2
1 files changed, 2 insertions, 0 deletions
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: