[cfe-commits] r54609 - /cfe/trunk/include/clang/AST/Expr.h
Daniel Dunbar
daniel at zuster.org
Sat Aug 9 23:58:01 PDT 2008
Author: ddunbar
Date: Sun Aug 10 01:58:01 2008
New Revision: 54609
URL: http://llvm.org/viewvc/llvm-project?rev=54609&view=rev
Log:
Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue.
Tweak getIntegerConstantExprValue to suppress warning in
Release-Asserts mode.
Modified:
cfe/trunk/include/clang/AST/Expr.h
Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=54609&r1=54608&r2=54609&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Sun Aug 10 01:58:01 2008
@@ -101,6 +101,7 @@
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 @@
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
More information about the cfe-commits
mailing list