summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-08-07 17:49:57 +0000
committerTed Kremenek <kremenek@apple.com>2008-08-07 17:49:57 +0000
commit31691ae8629b199f7f60c475415c0ba3f0920f0a (patch)
treebc52b8b67055384d56b64cd5efbfa5c3009b6c71 /clang/lib/Basic
parentdee8e7a233e45375c9053e8f435200e58b8153c1 (diff)
downloadbcm5719-llvm-31691ae8629b199f7f60c475415c0ba3f0920f0a.tar.gz
bcm5719-llvm-31691ae8629b199f7f60c475415c0ba3f0920f0a.zip
Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.
llvm-svn: 54472
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 35d665d1a5c..16bdd4a6c22 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/lib/Basic/Diagnostic.cpp
@@ -108,7 +108,7 @@ namespace clang {
// Common Diagnostic implementation
//===----------------------------------------------------------------------===//
-Diagnostic::Diagnostic(DiagnosticClient &client) : Client(client) {
+Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) {
IgnoreAllWarnings = false;
WarningsAsErrors = false;
WarnOnExtensions = false;
@@ -219,7 +219,7 @@ void Diagnostic::Report(DiagnosticClient* C,
return;
// Set the diagnostic client if it isn't set already.
- if (!C) C = &Client;
+ if (!C) C = Client;
// If this is not an error and we are in a system header, ignore it. We have
// to check on the original class here, because we also want to ignore
@@ -227,13 +227,13 @@ void Diagnostic::Report(DiagnosticClient* C,
// warnings/extensions to errors.
if (DiagID < diag::NUM_BUILTIN_DIAGNOSTICS &&
getBuiltinDiagClass(DiagID) != ERROR &&
- Client.isInSystemHeader(Pos))
+ Client->isInSystemHeader(Pos))
return;
if (DiagLevel >= Diagnostic::Error) {
ErrorOccurred = true;
- if (C == &Client)
+ if (C == Client)
++NumErrors;
}
@@ -242,7 +242,7 @@ void Diagnostic::Report(DiagnosticClient* C,
C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID,
Strs, NumStrs, Ranges, NumRanges);
- if (C == &Client)
+ if (C == Client)
++NumDiagnostics;
}
OpenPOWER on IntegriCloud