diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 9a263c1d0bc..31e33315cce 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/lib/Basic/Diagnostic.cpp @@ -62,6 +62,13 @@ Diagnostic::~Diagnostic() { delete Client; } +void Diagnostic::setClient(DiagnosticClient *client, bool ShouldOwnClient) { + if (OwnsDiagClient && Client) + delete Client; + + Client = client; + OwnsDiagClient = ShouldOwnClient; +} void Diagnostic::pushMappings(SourceLocation Loc) { DiagStateOnPushStack.push_back(GetCurDiagState()); |