aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/Diagnostic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/Diagnostic.h')
-rw-r--r--include/clang/Basic/Diagnostic.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h
index a7b2ba270d46..91e94db802b1 100644
--- a/include/clang/Basic/Diagnostic.h
+++ b/include/clang/Basic/Diagnostic.h
@@ -12,8 +12,8 @@
///
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_DIAGNOSTIC_H
-#define LLVM_CLANG_DIAGNOSTIC_H
+#ifndef LLVM_CLANG_BASIC_DIAGNOSTIC_H
+#define LLVM_CLANG_BASIC_DIAGNOSTIC_H
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/DiagnosticOptions.h"
@@ -187,7 +187,7 @@ private:
IntrusiveRefCntPtr<DiagnosticIDs> Diags;
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
DiagnosticConsumer *Client;
- bool OwnsDiagClient;
+ std::unique_ptr<DiagnosticConsumer> Owner;
SourceManager *SourceMgr;
/// \brief Mapping information for diagnostics.
@@ -302,7 +302,6 @@ private:
unsigned NumWarnings; ///< Number of warnings reported
unsigned NumErrors; ///< Number of errors reported
- unsigned NumErrorsSuppressed; ///< Number of errors suppressed
/// \brief A function pointer that converts an opaque diagnostic
/// argument to a strings.
@@ -369,14 +368,11 @@ public:
const DiagnosticConsumer *getClient() const { return Client; }
/// \brief Determine whether this \c DiagnosticsEngine object own its client.
- bool ownsClient() const { return OwnsDiagClient; }
-
+ bool ownsClient() const { return Owner != nullptr; }
+
/// \brief Return the current diagnostic client along with ownership of that
/// client.
- DiagnosticConsumer *takeClient() {
- OwnsDiagClient = false;
- return Client;
- }
+ std::unique_ptr<DiagnosticConsumer> takeClient() { return std::move(Owner); }
bool hasSourceManager() const { return SourceMgr != nullptr; }
SourceManager &getSourceManager() const {