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
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 436031b..edee8af 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3135,12 +3135,12 @@
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 @@
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());
}