diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-11 19:19:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-11 19:19:21 +0000 |
commit | cf0f51d10f01065bd7bc3ffe77e18c30dcbdbea3 (patch) | |
tree | 19562a42d42f557d79c4cbbbf6c229c2086b6b04 /lib | |
parent | 150c2120ab4a44b4ac62b401ffece9049ff9b2c0 (diff) |
rename "SInt" methods to "Int" in APValue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index 5826fab131..424d95e078 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -386,9 +386,9 @@ VisitSizeOfAlignOfTypeExpr(const SizeOfAlignOfTypeExpr *E) { //===----------------------------------------------------------------------===// bool Expr::tryEvaluate(APValue &Result, ASTContext &Ctx) const { + llvm::APSInt sInt(32); #if USE_NEW_EVALUATOR if (getType()->isIntegerType()) { - llvm::APSInt sInt(32); if (EvaluateInteger(this, sInt, Ctx)) { Result = APValue(sInt); return true; diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 183d9a9a24..4836be4b8e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1814,12 +1814,11 @@ QualType Sema::TryFixInvalidVariablyModifiedType(QualType T) { if (const VariableArrayType* VLATy = dyn_cast<VariableArrayType>(T)) { APValue Result; if (VLATy->getSizeExpr() && - VLATy->getSizeExpr()->tryEvaluate(Result, Context) && Result.isSInt() && - Result.getSInt() > llvm::APSInt(Result.getSInt().getBitWidth(), - Result.getSInt().isUnsigned())) { - return Context.getConstantArrayType(VLATy->getElementType(), - Result.getSInt(), - ArrayType::Normal, 0); + VLATy->getSizeExpr()->tryEvaluate(Result, Context) && Result.isInt()) { + llvm::APSInt &Res = Result.getInt(); + if (Res > llvm::APSInt(Res.getBitWidth(), Res.isUnsigned())) + return Context.getConstantArrayType(VLATy->getElementType(), + Res, ArrayType::Normal, 0); } } return QualType(); |