diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-10 19:56:51 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-10 19:56:51 +0000 |
commit | b53da8604800249ab936b1316b1d81a81841a3d8 (patch) | |
tree | 6c4da40d922f9c0f848547e400f1fd07cd831eba /include/clang/Rewrite | |
parent | f1d79b587c72d41cd154c158b8f87c920c109485 (diff) | |
download | clang-b53da8604800249ab936b1316b1d81a81841a3d8.tar.gz |
Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)
After post-commit review and community discussion, this seems like a
reasonable direction to continue, making ownership semantics explicit in
the source using the type system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Rewrite')
-rw-r--r-- | include/clang/Rewrite/Frontend/ASTConsumers.h | 28 | ||||
-rw-r--r-- | include/clang/Rewrite/Frontend/FrontendActions.h | 12 |
2 files changed, 20 insertions, 20 deletions
diff --git a/include/clang/Rewrite/Frontend/ASTConsumers.h b/include/clang/Rewrite/Frontend/ASTConsumers.h index 584af3fa18..9ea96cd423 100644 --- a/include/clang/Rewrite/Frontend/ASTConsumers.h +++ b/include/clang/Rewrite/Frontend/ASTConsumers.h @@ -15,6 +15,8 @@ #define REWRITE_ASTCONSUMERS_H #include "clang/Basic/LLVM.h" + +#include <memory> #include <string> namespace clang { @@ -26,23 +28,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/FrontendActions.h b/include/clang/Rewrite/Frontend/FrontendActions.h index fc79270748..eca3650d8f 100644 --- a/include/clang/Rewrite/Frontend/FrontendActions.h +++ b/include/clang/Rewrite/Frontend/FrontendActions.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 { |