Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable. Also get rid of a parameter that is both
unused and inaccurate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62951 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 70b63fe..86f1cd9 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -692,11 +692,10 @@
return false;
}
-bool Expr::isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const {
+bool Expr::isConstantInitializer(ASTContext &Ctx) const {
switch (getStmtClass()) {
default:
if (!isEvaluatable(Ctx)) {
- if (Loc) *Loc = getLocStart();
return false;
}
break;
@@ -704,13 +703,13 @@
return true;
case CompoundLiteralExprClass: {
const Expr *Exp = cast<CompoundLiteralExpr>(this)->getInitializer();
- return Exp->isConstantExpr(Ctx, Loc);
+ return Exp->isConstantInitializer(Ctx);
}
case InitListExprClass: {
const InitListExpr *Exp = cast<InitListExpr>(this);
unsigned numInits = Exp->getNumInits();
for (unsigned i = 0; i < numInits; i++) {
- if (!Exp->getInit(i)->isConstantExpr(Ctx, Loc))
+ if (!Exp->getInit(i)->isConstantInitializer(Ctx))
return false;
}
}