From 55ae319a28f06159d594fddad8d60b4e653ff1bb Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 23 Feb 2011 01:51:43 +0000 Subject: Update Sema::DiagRuntimeBehavior() to take an optional Stmt* to indicate the code the diagnostic is associated with. This Stmt* is unused, but we will use it shortly for pruning diagnostics associated with unreachable code. llvm-svn: 126286 --- clang/lib/Sema/SemaChecking.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaChecking.cpp') diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 436031b7a5a..edee8af72bb 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -3135,12 +3135,12 @@ void Sema::CheckArrayAccess(const clang::ArraySubscriptExpr *E) { if (index.slt(size)) return; - DiagRuntimeBehavior(E->getBase()->getLocStart(), + DiagRuntimeBehavior(E->getBase()->getLocStart(), BaseExpr, PDiag(diag::warn_array_index_exceeds_bounds) << index.toString(10, true) << size.toString(10, true) << IndexExpr->getSourceRange()); } else { - DiagRuntimeBehavior(E->getBase()->getLocStart(), + DiagRuntimeBehavior(E->getBase()->getLocStart(), BaseExpr, PDiag(diag::warn_array_index_precedes_bounds) << index.toString(10, true) << IndexExpr->getSourceRange()); @@ -3152,7 +3152,7 @@ void Sema::CheckArrayAccess(const clang::ArraySubscriptExpr *E) { if (const MemberExpr *ME = dyn_cast(BaseExpr)) ND = dyn_cast(ME->getMemberDecl()); if (ND) - DiagRuntimeBehavior(ND->getLocStart(), + DiagRuntimeBehavior(ND->getLocStart(), BaseExpr, PDiag(diag::note_array_index_out_of_bounds) << ND->getDeclName()); } -- cgit v1.2.3