diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-25 05:05:01 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-05-25 05:05:01 +0000 |
commit | 0e37afa15ea127909573a8f65dad72f30f70f2f0 (patch) | |
tree | 1a40cc2c6dcb2788f47c95d15bce6e5e5321f3be /clang/lib/Driver/Driver.cpp | |
parent | 0246d63715dfa2239c538b1a300183e8a64ff94a (diff) | |
download | bcm5719-llvm-0e37afa15ea127909573a8f65dad72f30f70f2f0.tar.gz bcm5719-llvm-0e37afa15ea127909573a8f65dad72f30f70f2f0.zip |
A StringRef-ication of the DiagnosticIDs API and internals.
Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.
Depends on llvm commit r132046.
llvm-svn: 132047
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index fe650547f19..9ebf850c3a3 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -398,9 +398,10 @@ void Driver::PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const { /// PrintDiagnosticCategories - Implement the --print-diagnostic-categories /// option. static void PrintDiagnosticCategories(llvm::raw_ostream &OS) { - for (unsigned i = 1; // Skip the empty category. - const char *CategoryName = DiagnosticIDs::getCategoryNameFromID(i); ++i) - OS << i << ',' << CategoryName << '\n'; + // Skip the empty category. + for (unsigned i = 1, max = DiagnosticIDs::getNumberOfCategories(); + i != max; ++i) + OS << i << ',' << DiagnosticIDs::getCategoryNameFromID(i) << '\n'; } bool Driver::HandleImmediateArgs(const Compilation &C) { |