diff options
Diffstat (limited to 'include/clang/Rewrite/Frontend')
| -rw-r--r-- | include/clang/Rewrite/Frontend/ASTConsumers.h | 31 | ||||
| -rw-r--r-- | include/clang/Rewrite/Frontend/FixItRewriter.h | 8 | ||||
| -rw-r--r-- | include/clang/Rewrite/Frontend/FrontendActions.h | 16 | ||||
| -rw-r--r-- | include/clang/Rewrite/Frontend/Rewriters.h | 4 |
4 files changed, 29 insertions, 30 deletions
diff --git a/include/clang/Rewrite/Frontend/ASTConsumers.h b/include/clang/Rewrite/Frontend/ASTConsumers.h index 584af3fa18b0..c9df8895041d 100644 --- a/include/clang/Rewrite/Frontend/ASTConsumers.h +++ b/include/clang/Rewrite/Frontend/ASTConsumers.h @@ -11,10 +11,11 @@ // //===----------------------------------------------------------------------===// -#ifndef REWRITE_ASTCONSUMERS_H -#define REWRITE_ASTCONSUMERS_H +#ifndef LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H +#define LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H #include "clang/Basic/LLVM.h" +#include <memory> #include <string> namespace clang { @@ -26,23 +27,21 @@ class Preprocessor; // ObjC rewriter: attempts to rewrite ObjC constructs into pure C code. // This is considered experimental, and only works with Apple's ObjC runtime. -ASTConsumer *CreateObjCRewriter(const std::string &InFile, - raw_ostream *OS, - DiagnosticsEngine &Diags, - const LangOptions &LOpts, - bool SilenceRewriteMacroWarning); -ASTConsumer *CreateModernObjCRewriter(const std::string &InFile, - raw_ostream *OS, - DiagnosticsEngine &Diags, - const LangOptions &LOpts, - bool SilenceRewriteMacroWarning, - bool LineInfo); +std::unique_ptr<ASTConsumer> +CreateObjCRewriter(const std::string &InFile, raw_ostream *OS, + DiagnosticsEngine &Diags, const LangOptions &LOpts, + bool SilenceRewriteMacroWarning); +std::unique_ptr<ASTConsumer> +CreateModernObjCRewriter(const std::string &InFile, raw_ostream *OS, + DiagnosticsEngine &Diags, const LangOptions &LOpts, + bool SilenceRewriteMacroWarning, bool LineInfo); /// CreateHTMLPrinter - Create an AST consumer which rewrites source code to /// HTML with syntax highlighting suitable for viewing in a web-browser. -ASTConsumer *CreateHTMLPrinter(raw_ostream *OS, Preprocessor &PP, - bool SyntaxHighlight = true, - bool HighlightMacros = true); +std::unique_ptr<ASTConsumer> CreateHTMLPrinter(raw_ostream *OS, + Preprocessor &PP, + bool SyntaxHighlight = true, + bool HighlightMacros = true); } // end clang namespace diff --git a/include/clang/Rewrite/Frontend/FixItRewriter.h b/include/clang/Rewrite/Frontend/FixItRewriter.h index 3ad8f408af6e..599417235464 100644 --- a/include/clang/Rewrite/Frontend/FixItRewriter.h +++ b/include/clang/Rewrite/Frontend/FixItRewriter.h @@ -12,8 +12,8 @@ // then forwards any diagnostics to the adapted diagnostic client. // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H -#define LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H +#ifndef LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H +#define LLVM_CLANG_REWRITE_FRONTEND_FIXITREWRITER_H #include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceLocation.h" @@ -66,7 +66,7 @@ class FixItRewriter : public DiagnosticConsumer { /// \brief The diagnostic client that performs the actual formatting /// of error messages. DiagnosticConsumer *Client; - bool OwnsClient; + std::unique_ptr<DiagnosticConsumer> Owner; /// \brief Turn an input path into an output path. NULL implies overwriting /// the original. @@ -125,4 +125,4 @@ public: } -#endif // LLVM_CLANG_REWRITE_FIX_IT_REWRITER_H +#endif diff --git a/include/clang/Rewrite/Frontend/FrontendActions.h b/include/clang/Rewrite/Frontend/FrontendActions.h index fc792707487d..c8ea8b2dd878 100644 --- a/include/clang/Rewrite/Frontend/FrontendActions.h +++ b/include/clang/Rewrite/Frontend/FrontendActions.h @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_REWRITE_FRONTENDACTIONS_H -#define LLVM_CLANG_REWRITE_FRONTENDACTIONS_H +#ifndef LLVM_CLANG_REWRITE_FRONTEND_FRONTENDACTIONS_H +#define LLVM_CLANG_REWRITE_FRONTEND_FRONTENDACTIONS_H #include "clang/Frontend/FrontendAction.h" @@ -22,8 +22,8 @@ class FixItOptions; class HTMLPrintAction : public ASTFrontendAction { protected: - ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) override; + std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override; }; class FixItAction : public ASTFrontendAction { @@ -31,8 +31,8 @@ protected: std::unique_ptr<FixItRewriter> Rewriter; std::unique_ptr<FixItOptions> FixItOpts; - ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) override; + std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override; bool BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) override; @@ -59,8 +59,8 @@ protected: class RewriteObjCAction : public ASTFrontendAction { protected: - ASTConsumer *CreateASTConsumer(CompilerInstance &CI, - StringRef InFile) override; + std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI, + StringRef InFile) override; }; class RewriteMacrosAction : public PreprocessorFrontendAction { diff --git a/include/clang/Rewrite/Frontend/Rewriters.h b/include/clang/Rewrite/Frontend/Rewriters.h index f5ade5ad35d3..3ad76dff824f 100644 --- a/include/clang/Rewrite/Frontend/Rewriters.h +++ b/include/clang/Rewrite/Frontend/Rewriters.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_CLANG_REWRITE_REWRITERS_H -#define LLVM_CLANG_REWRITE_REWRITERS_H +#ifndef LLVM_CLANG_REWRITE_FRONTEND_REWRITERS_H +#define LLVM_CLANG_REWRITE_FRONTEND_REWRITERS_H #include "clang/Basic/LLVM.h" |
