diff options
Diffstat (limited to 'include/clang/Frontend/VerifyDiagnosticConsumer.h')
-rw-r--r-- | include/clang/Frontend/VerifyDiagnosticConsumer.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/include/clang/Frontend/VerifyDiagnosticConsumer.h b/include/clang/Frontend/VerifyDiagnosticConsumer.h index 9273fac..80e140b 100644 --- a/include/clang/Frontend/VerifyDiagnosticConsumer.h +++ b/include/clang/Frontend/VerifyDiagnosticConsumer.h @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_FRONTEND_VERIFYDIAGNOSTICSCLIENT_H -#define LLVM_CLANG_FRONTEND_VERIFYDIAGNOSTICSCLIENT_H +#ifndef LLVM_CLANG_FRONTEND_VERIFYDIAGNOSTICCONSUMER_H +#define LLVM_CLANG_FRONTEND_VERIFYDIAGNOSTICCONSUMER_H #include "clang/Basic/Diagnostic.h" #include "clang/Lex/Preprocessor.h" @@ -145,9 +145,12 @@ public: /// class Directive { public: - static Directive *create(bool RegexKind, SourceLocation DirectiveLoc, - SourceLocation DiagnosticLoc, bool MatchAnyLine, - StringRef Text, unsigned Min, unsigned Max); + static std::unique_ptr<Directive> create(bool RegexKind, + SourceLocation DirectiveLoc, + SourceLocation DiagnosticLoc, + bool MatchAnyLine, StringRef Text, + unsigned Min, unsigned Max); + public: /// Constant representing n or more matches. static const unsigned MaxCount = UINT_MAX; @@ -181,7 +184,7 @@ public: void operator=(const Directive &) LLVM_DELETED_FUNCTION; }; - typedef std::vector<Directive*> DirectiveList; + typedef std::vector<std::unique_ptr<Directive>> DirectiveList; /// ExpectedData - owns directive objects and deletes on destructor. /// @@ -192,13 +195,11 @@ public: DirectiveList Notes; void Reset() { - llvm::DeleteContainerPointers(Errors); - llvm::DeleteContainerPointers(Warnings); - llvm::DeleteContainerPointers(Remarks); - llvm::DeleteContainerPointers(Notes); + Errors.clear(); + Warnings.clear(); + Remarks.clear(); + Notes.clear(); } - - ~ExpectedData() { Reset(); } }; enum DirectiveStatus { @@ -211,7 +212,7 @@ public: private: DiagnosticsEngine &Diags; DiagnosticConsumer *PrimaryClient; - bool OwnsPrimaryClient; + std::unique_ptr<DiagnosticConsumer> PrimaryClientOwner; std::unique_ptr<TextDiagnosticBuffer> Buffer; const Preprocessor *CurrentPreprocessor; const LangOptions *LangOpts; |