diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-03-31 18:23:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-03-31 18:23:15 +0000 |
commit | 615f5177095e62b36bf88f1b1b7b644295e4097b (patch) | |
tree | 8de14a0704d1ac13c3c1f4527a03f1e8dd124127 /lib/Basic | |
parent | f186f303ee0519d48a1bca24b7a9f4ad503bd5b2 (diff) |
Added variation of the "Report" method in the class Diagnostic that takes
an optional DiagnosticClient argument that differs from the client stored
internally in the Diagnostic object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48986 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index f62b8f126c..867b3dbec1 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -198,7 +198,8 @@ Diagnostic::Level Diagnostic::getDiagnosticLevel(unsigned DiagID) const { /// Report - Issue the message to the client. If the client wants us to stop /// compilation, return true, otherwise return false. DiagID is a member of /// the diag::kind enum. -void Diagnostic::Report(FullSourceLoc Pos, unsigned DiagID, +void Diagnostic::Report(DiagnosticClient* C, + FullSourceLoc Pos, unsigned DiagID, const std::string *Strs, unsigned NumStrs, const SourceRange *Ranges, unsigned NumRanges) { @@ -224,8 +225,11 @@ void Diagnostic::Report(FullSourceLoc Pos, unsigned DiagID, } // Finally, report it. - Client.HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID, - Strs, NumStrs, Ranges, NumRanges); + + if (!C) C = &Client; + + C->HandleDiagnostic(*this, DiagLevel, Pos, (diag::kind)DiagID, + Strs, NumStrs, Ranges, NumRanges); ++NumDiagnostics; } |