summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-03-31 18:23:15 +0000
committerTed Kremenek <kremenek@apple.com>2008-03-31 18:23:15 +0000
commit491dc9f4a0c3c0bcbcca433899366007e91ead34 (patch)
tree34343d2715513c0b4650f2670117065396155050 /clang/lib
parent765457e28fcd43f009fd73fc66ad5a7e093774f1 (diff)
downloadbcm5719-llvm-491dc9f4a0c3c0bcbcca433899366007e91ead34.tar.gz
bcm5719-llvm-491dc9f4a0c3c0bcbcca433899366007e91ead34.zip
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. llvm-svn: 48986
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index f62b8f126cd..867b3dbec1a 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud