]> granicus.if.org Git - clang/commitdiff
Make DiagnosticIDs::getAllDiagnostics use std::vector. NFC.
authorGabor Horvath <xazax.hun@gmail.com>
Wed, 20 Dec 2017 16:55:41 +0000 (16:55 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Wed, 20 Dec 2017 16:55:41 +0000 (16:55 +0000)
The size of the result vector is currently around 4600 with
Flavor::WarningOrError, which makes std::vector a better candidate than
llvm::SmallVector.

Patch by: Andras Leitereg!

Differential Revision: https://reviews.llvm.org/D39372

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321190 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticIDs.h
lib/Basic/Diagnostic.cpp
lib/Basic/DiagnosticIDs.cpp

index 43183a120bb9a099875126f6c36440765023c1e1..b4ea85ba853ccc8e1642b093f0bb81d1e98d6faa 100644 (file)
@@ -297,7 +297,7 @@ public:
 
   /// \brief Get the set of all diagnostic IDs.
   static void getAllDiagnostics(diag::Flavor Flavor,
-                                SmallVectorImpl<diag::kind> &Diags);
+                                std::vector<diag::kind> &Diags);
 
   /// \brief Get the diagnostic option with the closest edit distance to the
   /// given group name.
index 640b42c1ca2e67f00fc6d7ca57d5c523be0a0e4e..26baa838f8c687cf585e763226d226e8cebc57ae 100644 (file)
@@ -363,7 +363,7 @@ void DiagnosticsEngine::setSeverityForAll(diag::Flavor Flavor,
                                           diag::Severity Map,
                                           SourceLocation Loc) {
   // Get all the diagnostics.
-  SmallVector<diag::kind, 64> AllDiags;
+  std::vector<diag::kind> AllDiags;
   DiagnosticIDs::getAllDiagnostics(Flavor, AllDiags);
 
   // Set the mapping.
index 5c53f35aa68f0da5928fd47b68eb43944071416d..c4c425d9eb1df0b4c7510f9f5c492caf5c6a7c23 100644 (file)
@@ -583,7 +583,7 @@ DiagnosticIDs::getDiagnosticsInGroup(diag::Flavor Flavor, StringRef Group,
 }
 
 void DiagnosticIDs::getAllDiagnostics(diag::Flavor Flavor,
-                                      SmallVectorImpl<diag::kind> &Diags) {
+                                      std::vector<diag::kind> &Diags) {
   for (unsigned i = 0; i != StaticDiagInfoSize; ++i)
     if (StaticDiagInfo[i].getFlavor() == Flavor)
       Diags.push_back(StaticDiagInfo[i].DiagID);