summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-02-23 01:51:43 +0000
committerTed Kremenek <kremenek@apple.com>2011-02-23 01:51:43 +0000
commit55ae319a28f06159d594fddad8d60b4e653ff1bb (patch)
tree3a514afa78d269e2a00b0a7eba8bb6be9eba9334 /clang/lib/Sema/SemaChecking.cpp
parentdb3333df71a997f8d795882eac8599f9227184ae (diff)
downloadbcm5719-llvm-55ae319a28f06159d594fddad8d60b4e653ff1bb.tar.gz
bcm5719-llvm-55ae319a28f06159d594fddad8d60b4e653ff1bb.zip
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
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp6
1 files changed, 3 insertions, 3 deletions
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<MemberExpr>(BaseExpr))
ND = dyn_cast<NamedDecl>(ME->getMemberDecl());
if (ND)
- DiagRuntimeBehavior(ND->getLocStart(),
+ DiagRuntimeBehavior(ND->getLocStart(), BaseExpr,
PDiag(diag::note_array_index_out_of_bounds)
<< ND->getDeclName());
}
OpenPOWER on IntegriCloud