leanil created this revision.
leanil added reviewers: rsmith, xazax.hun.
Herald added a subscriber: rnkovacs.
The size of the result vector is currently around 4600 with
Flavor::WarningOrError, which makes std::vector a better candidate than
llvm::SmallVector.
https://reviews.llvm.org/D41451
Files:
include/clang/Basic/DiagnosticIDs.h
lib/Basic/Diagnostic.cpp
lib/Basic/DiagnosticIDs.cpp
Index: lib/Basic/DiagnosticIDs.cpp
===
--- lib/Basic/DiagnosticIDs.cpp
+++ lib/Basic/DiagnosticIDs.cpp
@@ -583,7 +583,7 @@
}
void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor,
- SmallVectorImpl &Diags) {
+ std::vector &Diags) {
for (unsigned i = 0; i != StaticDiagInfoSize; ++i)
if (StaticDiagInfo[i].getFlavor() == Flavor)
Diags.push_back(StaticDiagInfo[i].DiagID);
Index: lib/Basic/Diagnostic.cpp
===
--- lib/Basic/Diagnostic.cpp
+++ lib/Basic/Diagnostic.cpp
@@ -363,7 +363,7 @@
diag::Severity Map,
SourceLocation Loc) {
// Get all the diagnostics.
- SmallVector AllDiags;
+ std::vector AllDiags;
DiagnosticIDs::getAllDiagnostics(Flavor, AllDiags);
// Set the mapping.
Index: include/clang/Basic/DiagnosticIDs.h
===
--- include/clang/Basic/DiagnosticIDs.h
+++ include/clang/Basic/DiagnosticIDs.h
@@ -297,7 +297,7 @@
/// \brief Get the set of all diagnostic IDs.
static void getAllDiagnostics(diag::Flavor Flavor,
-SmallVectorImpl &Diags);
+std::vector &Diags);
/// \brief Get the diagnostic option with the closest edit distance to the
/// given group name.
Index: lib/Basic/DiagnosticIDs.cpp
===
--- lib/Basic/DiagnosticIDs.cpp
+++ lib/Basic/DiagnosticIDs.cpp
@@ -583,7 +583,7 @@
}
void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor,
- SmallVectorImpl &Diags) {
+ std::vector &Diags) {
for (unsigned i = 0; i != StaticDiagInfoSize; ++i)
if (StaticDiagInfo[i].getFlavor() == Flavor)
Diags.push_back(StaticDiagInfo[i].DiagID);
Index: lib/Basic/Diagnostic.cpp
===
--- lib/Basic/Diagnostic.cpp
+++ lib/Basic/Diagnostic.cpp
@@ -363,7 +363,7 @@
diag::Severity Map,
SourceLocation Loc) {
// Get all the diagnostics.
- SmallVector AllDiags;
+ std::vector AllDiags;
DiagnosticIDs::getAllDiagnostics(Flavor, AllDiags);
// Set the mapping.
Index: include/clang/Basic/DiagnosticIDs.h
===
--- include/clang/Basic/DiagnosticIDs.h
+++ include/clang/Basic/DiagnosticIDs.h
@@ -297,7 +297,7 @@
/// \brief Get the set of all diagnostic IDs.
static void getAllDiagnostics(diag::Flavor Flavor,
-SmallVectorImpl &Diags);
+std::vector &Diags);
/// \brief Get the diagnostic option with the closest edit distance to the
/// given group name.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits