From 21cde050b64eefbb5094af67985752eee42d00e2 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 16 Jul 2013 22:40:53 +0000 Subject: Make Expr::isConstantInitializer match IRGen. Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186464 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExprScalar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExprScalar.cpp') diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 8e81866665..bfd880a7e3 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -2958,7 +2958,7 @@ static bool isCheapEnoughToEvaluateUnconditionally(const Expr *E, E = E->IgnoreParens(); // Anything that is an integer or floating point constant is fine. - if (E->isConstantInitializer(CGF.getContext(), false)) + if (E->isEvaluatable(CGF.getContext())) return true; // Non-volatile automatic variables too, to get "cond ? X : Y" where -- cgit v1.2.3