summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-23 01:20:39 +0000
committerChris Lattner <sabre@nondot.org>2009-06-23 01:20:39 +0000
commite2170edfbb593cf143995f3104115c23008af174 (patch)
treeda4599b1a33feb2f36442ac701b81b9de4bb1698 /clang/lib
parentfb87e308150f079bb602199d661b10d736b9dc55 (diff)
downloadbcm5719-llvm-e2170edfbb593cf143995f3104115c23008af174.tar.gz
bcm5719-llvm-e2170edfbb593cf143995f3104115c23008af174.zip
switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Among other things, this makes the warning about unknown warning options mappable. For example: $ clang t.c -Werror -Wfoo error: unknown warning option '-Wfoo' [-Wunknown-warning-option] For another thing, they are properly color coded now too :) llvm-svn: 73936
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/Warnings.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/Warnings.cpp b/clang/lib/Frontend/Warnings.cpp
index 81f75bdf755..c8fd5f6fcbc 100644
--- a/clang/lib/Frontend/Warnings.cpp
+++ b/clang/lib/Frontend/Warnings.cpp
@@ -24,6 +24,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Lex/LexDiagnostic.h"
+#include "clang/Frontend/FrontendDiagnostic.h"
#include <cstdio>
#include <cstring>
#include <utility>
@@ -99,7 +100,8 @@ bool clang::ProcessWarningOptions(Diagnostic &Diags,
}
if (Diags.setDiagnosticGroupMapping(OptStart, Mapping))
- fprintf(stderr, "warning: unknown warning option: -W%s\n", Opt.c_str());
+ Diags.Report(FullSourceLoc(), diag::warn_unknown_warning_option)
+ << ("-W" + Opt);
}
return false;
OpenPOWER on IntegriCloud