diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-12-15 18:49:47 +0000 |
commit | 34d02d0b37f16015f317a935c48ce8b7b64ae77b (patch) | |
tree | 2fd5819f49caecc5f520219b6b9254fe94ebb138 /lib/Sema/SemaChecking.cpp | |
parent | 1569ce68681d909594d64f9b056d71f5dd7563bf (diff) | |
download | src-34d02d0b37f16015f317a935c48ce8b7b64ae77b.tar.gz src-34d02d0b37f16015f317a935c48ce8b7b64ae77b.zip |
Update clang to 91430.
Notes
Notes:
svn path=/vendor/clang/dist/; revision=200583
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 9060fe6ab742..28de5005f8a8 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -700,30 +700,30 @@ bool Sema::SemaBuiltinPrefetch(CallExpr *TheCall) { if (Arg->isTypeDependent()) continue; - QualType RWType = Arg->getType(); - - const BuiltinType *BT = RWType->getAs<BuiltinType>(); - llvm::APSInt Result; - if (!BT || BT->getKind() != BuiltinType::Int) - return Diag(TheCall->getLocStart(), diag::err_prefetch_invalid_argument) + if (!Arg->getType()->isIntegralType()) + return Diag(TheCall->getLocStart(), diag::err_prefetch_invalid_arg_type) << Arg->getSourceRange(); + ImpCastExprToType(Arg, Context.IntTy, CastExpr::CK_IntegralCast); + TheCall->setArg(i, Arg); + if (Arg->isValueDependent()) continue; + llvm::APSInt Result; if (!Arg->isIntegerConstantExpr(Result, Context)) - return Diag(TheCall->getLocStart(), diag::err_prefetch_invalid_argument) + return Diag(TheCall->getLocStart(), diag::err_prefetch_invalid_arg_ice) << SourceRange(Arg->getLocStart(), Arg->getLocEnd()); // FIXME: gcc issues a warning and rewrites these to 0. These // seems especially odd for the third argument since the default // is 3. if (i == 1) { - if (Result.getSExtValue() < 0 || Result.getSExtValue() > 1) + if (Result.getLimitedValue() > 1) return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range) << "0" << "1" << Arg->getSourceRange(); } else { - if (Result.getSExtValue() < 0 || Result.getSExtValue() > 3) + if (Result.getLimitedValue() > 3) return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range) << "0" << "3" << Arg->getSourceRange(); } |