diff options
Diffstat (limited to 'utils/TableGen/ClangDiagnosticsEmitter.cpp')
-rw-r--r-- | utils/TableGen/ClangDiagnosticsEmitter.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/utils/TableGen/ClangDiagnosticsEmitter.cpp b/utils/TableGen/ClangDiagnosticsEmitter.cpp index 520ec0a2c5..2df7ca97ce 100644 --- a/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -11,16 +11,16 @@ // //===----------------------------------------------------------------------===// -#include "ClangDiagnosticsEmitter.h" -#include "llvm/TableGen/Record.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/Compiler.h" #include "llvm/ADT/DenseSet.h" -#include "llvm/ADT/StringMap.h" #include "llvm/ADT/SmallString.h" -#include <map> +#include "llvm/ADT/StringMap.h" +#include "llvm/Support/Compiler.h" +#include "llvm/Support/Debug.h" +#include "llvm/TableGen/Record.h" +#include "llvm/TableGen/TableGenBackend.h" #include <algorithm> #include <functional> +#include <map> #include <set> using namespace llvm; @@ -163,7 +163,11 @@ static void groupDiagnostics(const std::vector<Record*> &Diags, // Warning Tables (.inc file) generation. //===----------------------------------------------------------------------===// -void ClangDiagsDefsEmitter::run(raw_ostream &OS) { +/// ClangDiagsDefsEmitter - The top-level class emits .def files containing +/// declarations of Clang diagnostics. +namespace clang { +void EmitClangDiagsDefs(RecordKeeper &Records, raw_ostream &OS, + const std::string &Component) { // Write the #if guard if (!Component.empty()) { std::string ComponentName = StringRef(Component).upper(); @@ -244,6 +248,7 @@ void ClangDiagsDefsEmitter::run(raw_ostream &OS) { OS << ")\n"; } } +} // end namespace clang //===----------------------------------------------------------------------===// // Warning Group Tables generation @@ -258,7 +263,8 @@ static std::string getDiagCategoryEnum(llvm::StringRef name) { return enumName.str(); } -void ClangDiagGroupsEmitter::run(raw_ostream &OS) { +namespace clang { +void EmitClangDiagGroups(RecordKeeper &Records, raw_ostream &OS) { // Compute a mapping from a DiagGroup to all of its parents. DiagGroupParentMap DGParentMap(Records); @@ -339,6 +345,7 @@ void ClangDiagGroupsEmitter::run(raw_ostream &OS) { OS << "CATEGORY(\"" << *I << "\", " << getDiagCategoryEnum(*I) << ")\n"; OS << "#endif // GET_CATEGORY_TABLE\n\n"; } +} // end namespace clang //===----------------------------------------------------------------------===// // Diagnostic name index generation @@ -366,7 +373,8 @@ struct RecordIndexElementSorter : } // end anonymous namespace. -void ClangDiagsIndexNameEmitter::run(raw_ostream &OS) { +namespace clang { +void EmitClangDiagsIndexName(RecordKeeper &Records, raw_ostream &OS) { const std::vector<Record*> &Diags = Records.getAllDerivedDefinitions("Diagnostic"); @@ -385,3 +393,4 @@ void ClangDiagsIndexNameEmitter::run(raw_ostream &OS) { OS << "DIAG_NAME_INDEX(" << R.Name << ")\n"; } } +} // end namespace clang |