summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-05-22 19:56:11 +0000
committerAlexander Kornienko <alexfh@google.com>2014-05-22 19:56:11 +0000
commitd3b4e08960ad6618b4448fd2c0c38c8c4fa6d72b (patch)
tree08dca0c053d8f5455c9c56e6d56e81b30f835e74 /clang/lib/Basic/Diagnostic.cpp
parentd328db1318f082fae9102df791d41d0231ddbcf4 (diff)
downloadbcm5719-llvm-d3b4e08960ad6618b4448fd2c0c38c8c4fa6d72b.tar.gz
bcm5719-llvm-d3b4e08960ad6618b4448fd2c0c38c8c4fa6d72b.zip
Remove limits on the number of fix-it hints and ranges in the DiagnosticsEngine.
Summary: The limits on the number of fix-it hints and ranges attached to a diagnostic are arbitrary and don't apply universally to all users of the DiagnosticsEngine. The way the limits are enforced may lead to diagnostics generating invalid sets of fixes. I suggest removing the limits, which will also simplify the implementation. Reviewers: rsmith Reviewed By: rsmith Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D3879 llvm-svn: 209468
Diffstat (limited to 'clang/lib/Basic/Diagnostic.cpp')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 8cef9d5b19a..13d25249015 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -323,22 +323,19 @@ void DiagnosticsEngine::Report(const StoredDiagnostic &storedDiag) {
CurDiagID = storedDiag.getID();
NumDiagArgs = 0;
- NumDiagRanges = storedDiag.range_size();
- assert(NumDiagRanges < DiagnosticsEngine::MaxRanges &&
- "Too many arguments to diagnostic!");
- unsigned i = 0;
+ DiagRanges.clear();
+ DiagRanges.reserve(storedDiag.range_size());
for (StoredDiagnostic::range_iterator
RI = storedDiag.range_begin(),
RE = storedDiag.range_end(); RI != RE; ++RI)
- DiagRanges[i++] = *RI;
+ DiagRanges.push_back(*RI);
- assert(NumDiagRanges < DiagnosticsEngine::MaxFixItHints &&
- "Too many arguments to diagnostic!");
- NumDiagFixItHints = 0;
+ DiagFixItHints.clear();
+ DiagFixItHints.reserve(storedDiag.fixit_size());
for (StoredDiagnostic::fixit_iterator
FI = storedDiag.fixit_begin(),
FE = storedDiag.fixit_end(); FI != FE; ++FI)
- DiagFixItHints[NumDiagFixItHints++] = *FI;
+ DiagFixItHints.push_back(*FI);
assert(Client && "DiagnosticConsumer not set!");
Level DiagLevel = storedDiag.getLevel();
OpenPOWER on IntegriCloud