diff options
Diffstat (limited to 'lib/Basic/DiagnosticIDs.cpp')
| -rw-r--r-- | lib/Basic/DiagnosticIDs.cpp | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index ce493c1e5caba..932b3f1934cc4 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -510,6 +510,18 @@ StringRef DiagnosticIDs::getWarningOptionForDiag(unsigned DiagID) {    return StringRef();  } +std::vector<std::string> DiagnosticIDs::getDiagnosticFlags() { +  std::vector<std::string> Res; +  for (size_t I = 1; DiagGroupNames[I] != '\0';) { +    std::string Diag(DiagGroupNames + I + 1, DiagGroupNames[I]); +    I += DiagGroupNames[I] + 1; +    Res.push_back("-W" + Diag); +    Res.push_back("-Wno" + Diag); +  } + +  return Res; +} +  /// Return \c true if any diagnostics were found in this group, even if they  /// were filtered out due to having the wrong flavor.  static bool getDiagnosticsInGroup(diag::Flavor Flavor,  | 
