aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-08-10 06:58:01 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-08-10 06:58:01 +0000
commita5d1cb7ef3f0780540e7fd7180399fd220ef0210 (patch)
tree24f0c603c921c1fc61133057047f0bc0de629adc
parentec5c2a7646e4e23a4bed77443415938b140d7aa7 (diff)
Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue. Tweak getIntegerConstantExprValue to suppress warning in Release-Asserts mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54609 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Expr.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index a92b940ead..5a3e8f78e2 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -101,6 +101,7 @@ public:
llvm::APSInt getIntegerConstantExprValue(ASTContext &Ctx) const {
llvm::APSInt X(32);
bool success = isIntegerConstantExpr(X, Ctx);
+ success = success;
assert(success && "Illegal argument to getIntegerConstantExpr");
return X;
}
@@ -1214,10 +1215,7 @@ public:
unsigned getShuffleMaskIdx(ASTContext &Ctx, unsigned N) {
assert((N < NumExprs - 2) && "Shuffle idx out of range!");
- llvm::APSInt Result(32);
- bool result = getExpr(N+2)->isIntegerConstantExpr(Result, Ctx);
- assert(result && "Must be integer constant");
- return Result.getZExtValue();
+ return getExpr(N+2)->getIntegerConstantExprValue(Ctx).getZExtValue();
}
// Iterators