From a5d1cb7ef3f0780540e7fd7180399fd220ef0210 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 10 Aug 2008 06:58:01 +0000 Subject: [PATCH] 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 --- include/clang/AST/Expr.h | 6 ++---- 1 file 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 -- 2.50.1