summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-15 23:29:09 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-15 23:29:09 +0000
commitbc92f8c9f98a72f6ae8da0fc374b34537ed52c5f (patch)
treeb6b85ecfa33a2d07a7cc8b04d99ba81350c043be
parentfce4be843ef8f16e778235604593d36b0e4980ea (diff)
downloadbcm5719-llvm-bc92f8c9f98a72f6ae8da0fc374b34537ed52c5f.tar.gz
bcm5719-llvm-bc92f8c9f98a72f6ae8da0fc374b34537ed52c5f.zip
Update Expr::{getIntegerConstantExprValue, isIntegerConstantExpr} to
use default APSInt constructor instead of embedding arbitrary constant. Update OverloadExpr::getNumArgs to use getIntegerConstantExprValue. Update OverloadExpr::getExpr to be const. llvm-svn: 54828
-rw-r--r--clang/include/clang/AST/Expr.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 9b6ce2fc8f5..bc99edf1747 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -97,7 +97,7 @@ public:
/// constant expression. The expression must be a valid integer
/// constant expression as determined by isIntegerConstantExpr.
llvm::APSInt getIntegerConstantExprValue(ASTContext &Ctx) const {
- llvm::APSInt X(32);
+ llvm::APSInt X;
bool success = isIntegerConstantExpr(X, Ctx);
success = success;
assert(success && "Illegal argument to getIntegerConstantExpr");
@@ -112,7 +112,7 @@ public:
SourceLocation *Loc = 0,
bool isEvaluated = true) const;
bool isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc = 0) const {
- llvm::APSInt X(32);
+ llvm::APSInt X;
return isIntegerConstantExpr(X, Ctx, Loc);
}
/// isConstantExpr - Return true if this expression is a valid constant expr.
@@ -1320,9 +1320,7 @@ public:
/// getNumArgs - Return the number of arguments to pass to the candidate
/// functions.
unsigned getNumArgs(ASTContext &Ctx) const {
- llvm::APSInt constEval(32);
- (void) cast<Expr>(SubExprs[0])->isIntegerConstantExpr(constEval, Ctx);
- return constEval.getZExtValue();
+ return getExpr(0)->getIntegerConstantExprValue(Ctx).getZExtValue();
}
/// getNumSubExprs - Return the size of the SubExprs array. This includes the
@@ -1331,7 +1329,7 @@ public:
unsigned getNumSubExprs() const { return NumExprs; }
/// getExpr - Return the Expr at the specified index.
- Expr *getExpr(unsigned Index) {
+ Expr *getExpr(unsigned Index) const {
assert((Index < NumExprs) && "Arg access out of range!");
return cast<Expr>(SubExprs[Index]);
}
OpenPOWER on IntegriCloud