diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-07-17 20:40:36 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-07-17 20:40:36 +0000 |
commit | 4d15e347a0bb35430635e1ae50d429c49761ae31 (patch) | |
tree | acf66daecbe11d2bbc0db6285245ec70edb71dfb /include/clang/Frontend/ASTConsumers.h | |
parent | 6042ad3646ce7238962b2fdfd60c66c2dc06df1c (diff) |
unique_ptr-ify ownership of ASTConsumers
(after fixing a bug in MultiplexConsumer I noticed the ownership of the
nested consumers was implemented with raw pointers - so this fixes
that... and follows the source back to its origin pushing unique_ptr
ownership up through there too)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/ASTConsumers.h')
-rw-r--r-- | include/clang/Frontend/ASTConsumers.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h index 366c499b67..4afcb0c28a 100644 --- a/include/clang/Frontend/ASTConsumers.h +++ b/include/clang/Frontend/ASTConsumers.h @@ -16,6 +16,8 @@ #include "clang/Basic/LLVM.h" +#include <memory> + namespace clang { class ASTConsumer; @@ -30,24 +32,26 @@ class TargetOptions; // original C code. The output is intended to be in a format such that // clang could re-parse the output back into the same AST, but the // implementation is still incomplete. -ASTConsumer *CreateASTPrinter(raw_ostream *OS, StringRef FilterString); +std::unique_ptr<ASTConsumer> CreateASTPrinter(raw_ostream *OS, + StringRef FilterString); // AST dumper: dumps the raw AST in human-readable form to stderr; this is // intended for debugging. -ASTConsumer *CreateASTDumper(StringRef FilterString, bool DumpLookups = false); +std::unique_ptr<ASTConsumer> CreateASTDumper(StringRef FilterString, + bool DumpLookups = false); // AST Decl node lister: prints qualified names of all filterable AST Decl // nodes. -ASTConsumer *CreateASTDeclNodeLister(); +std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister(); // Graphical AST viewer: for each function definition, creates a graph of // the AST and displays it with the graph viewer "dotty". Also outputs // function declarations to stderr. -ASTConsumer *CreateASTViewer(); +std::unique_ptr<ASTConsumer> CreateASTViewer(); // DeclContext printer: prints out the DeclContext tree in human-readable form // to stderr; this is intended for debugging. -ASTConsumer *CreateDeclContextPrinter(); +std::unique_ptr<ASTConsumer> CreateDeclContextPrinter(); } // end clang namespace |