diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-01-25 02:32:41 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-01-25 02:32:41 +0000 |
commit | 7139af42ce181d285e9c5aa1301403c2eaec665c (patch) | |
tree | 6b052eed4b53e3096fc6e517caa98713ddbac18c /clang/lib/AST/Expr.cpp | |
parent | cf2b7ba4a762ae463ef45ee3f004ef6e309e5124 (diff) | |
download | bcm5719-llvm-7139af42ce181d285e9c5aa1301403c2eaec665c.tar.gz bcm5719-llvm-7139af42ce181d285e9c5aa1301403c2eaec665c.zip |
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.
llvm-svn: 62951
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 70b63fea1bd..86f1cd9fdba 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -692,11 +692,10 @@ bool Expr::hasAnyValueDependentArguments(Expr** Exprs, unsigned NumExprs) { 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 @@ bool Expr::isConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { 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; } } |