Deleted Added
full compact
ChainedDiagnosticConsumer.h (276479) ChainedDiagnosticConsumer.h (280031)
1//===- ChainedDiagnosticConsumer.h - Chain Diagnostic Clients ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 8 unchanged lines hidden (view full) ---

17class LangOptions;
18
19/// ChainedDiagnosticConsumer - Chain two diagnostic clients so that diagnostics
20/// go to the first client and then the second. The first diagnostic client
21/// should be the "primary" client, and will be used for computing whether the
22/// diagnostics should be included in counts.
23class ChainedDiagnosticConsumer : public DiagnosticConsumer {
24 virtual void anchor();
1//===- ChainedDiagnosticConsumer.h - Chain Diagnostic Clients ---*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 8 unchanged lines hidden (view full) ---

17class LangOptions;
18
19/// ChainedDiagnosticConsumer - Chain two diagnostic clients so that diagnostics
20/// go to the first client and then the second. The first diagnostic client
21/// should be the "primary" client, and will be used for computing whether the
22/// diagnostics should be included in counts.
23class ChainedDiagnosticConsumer : public DiagnosticConsumer {
24 virtual void anchor();
25 std::unique_ptr Primary;
25 std::unique_ptr<DiagnosticConsumer> OwningPrimary;
26 DiagnosticConsumer *Primary;
26 std::unique_ptr<DiagnosticConsumer> Secondary;
27
28public:
27 std::unique_ptr<DiagnosticConsumer> Secondary;
28
29public:
29 ChainedDiagnosticConsumer(DiagnosticConsumer *_Primary,
30 DiagnosticConsumer *_Secondary) {
31 Primary.reset(_Primary);
32 Secondary.reset(_Secondary);
33 }
30 ChainedDiagnosticConsumer(std::unique_ptr<DiagnosticConsumer> Primary,
31 std::unique_ptr<DiagnosticConsumer> Secondary)
32 : OwningPrimary(std::move(Primary)), Primary(OwningPrimary.get()),
33 Secondary(std::move(Secondary)) {}
34
34
35 /// \brief Construct without taking ownership of \c Primary.
36 ChainedDiagnosticConsumer(DiagnosticConsumer *Primary,
37 std::unique_ptr<DiagnosticConsumer> Secondary)
38 : Primary(Primary), Secondary(std::move(Secondary)) {}
39
35 void BeginSourceFile(const LangOptions &LO,
36 const Preprocessor *PP) override {
37 Primary->BeginSourceFile(LO, PP);
38 Secondary->BeginSourceFile(LO, PP);
39 }
40
41 void EndSourceFile() override {
42 Secondary->EndSourceFile();

--- 25 unchanged lines hidden ---
40 void BeginSourceFile(const LangOptions &LO,
41 const Preprocessor *PP) override {
42 Primary->BeginSourceFile(LO, PP);
43 Secondary->BeginSourceFile(LO, PP);
44 }
45
46 void EndSourceFile() override {
47 Secondary->EndSourceFile();

--- 25 unchanged lines hidden ---