diff options
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 8b9e132..7ce3513 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -5954,9 +5954,6 @@ bool Sema::BuiltinAssumeAligned(CallExpr *TheCall) { if (Result > Sema::MaximumAlignment) Diag(TheCall->getBeginLoc(), diag::warn_assume_aligned_too_great) << SecondArg->getSourceRange() << Sema::MaximumAlignment; - - TheCall->setArg(1, - ConstantExpr::Create(Context, SecondArg, APValue(Result))); } if (NumArgs > 2) { @@ -14884,13 +14881,11 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr, // Diag message shows element size in bits and in "bytes" (platform- // dependent CharUnits) DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr, - PDiag(DiagID) - << toString(index, 10, true) << AddrBits - << (unsigned)ASTC.toBits(*ElemCharUnits) - << toString(ElemBytes, 10, false) - << toString(MaxElems, 10, false) - << (unsigned)MaxElems.getLimitedValue(~0U) - << IndexExpr->getSourceRange()); + PDiag(DiagID) << index << AddrBits + << (unsigned)ASTC.toBits(*ElemCharUnits) + << ElemBytes << MaxElems + << MaxElems.getZExtValue() + << IndexExpr->getSourceRange()); const NamedDecl *ND = nullptr; // Try harder to find a NamedDecl to point at in the note. @@ -14973,10 +14968,10 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr, unsigned CastMsg = (!ASE || BaseType == EffectiveType) ? 0 : 1; QualType CastMsgTy = ASE ? ASE->getLHS()->getType() : QualType(); - DiagRuntimeBehavior( - BaseExpr->getBeginLoc(), BaseExpr, - PDiag(DiagID) << toString(index, 10, true) << ArrayTy->desugar() - << CastMsg << CastMsgTy << IndexExpr->getSourceRange()); + DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr, + PDiag(DiagID) + << index << ArrayTy->desugar() << CastMsg + << CastMsgTy << IndexExpr->getSourceRange()); } else { unsigned DiagID = diag::warn_array_index_precedes_bounds; if (!ASE) { @@ -14985,8 +14980,7 @@ void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr, } DiagRuntimeBehavior(BaseExpr->getBeginLoc(), BaseExpr, - PDiag(DiagID) << toString(index, 10, true) - << IndexExpr->getSourceRange()); + PDiag(DiagID) << index << IndexExpr->getSourceRange()); } const NamedDecl *ND = nullptr; |