r215360 - Increase SmallVector<> size in DiagnosticsEngine::setSeverityForGroup
Hans Wennborg
hans at hanshq.net
Mon Aug 11 09:05:54 PDT 2014
Author: hans
Date: Mon Aug 11 11:05:54 2014
New Revision: 215360
URL: http://llvm.org/viewvc/llvm-project?rev=215360&view=rev
Log:
Increase SmallVector<> size in DiagnosticsEngine::setSeverityForGroup
In a Clang bootstrap, this vector always held 129 elements.
Also switch to a range-based for loop.
Modified:
cfe/trunk/lib/Basic/Diagnostic.cpp
Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=215360&r1=215359&r2=215360&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Mon Aug 11 11:05:54 2014
@@ -232,13 +232,13 @@ bool DiagnosticsEngine::setSeverityForGr
StringRef Group, diag::Severity Map,
SourceLocation Loc) {
// Get the diagnostics in this group.
- SmallVector<diag::kind, 8> GroupDiags;
+ SmallVector<diag::kind, 256> GroupDiags;
if (Diags->getDiagnosticsInGroup(Flavor, Group, GroupDiags))
return true;
// Set the mapping.
- for (unsigned i = 0, e = GroupDiags.size(); i != e; ++i)
- setSeverity(GroupDiags[i], Map, Loc);
+ for (diag::kind Diag : GroupDiags)
+ setSeverity(Diag, Map, Loc);
return false;
}
More information about the cfe-commits
mailing list