summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/ASTConsumers.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-10 19:56:51 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-10 19:56:51 +0000
commitb53da8604800249ab936b1316b1d81a81841a3d8 (patch)
tree6c4da40d922f9c0f848547e400f1fd07cd831eba /include/clang/Frontend/ASTConsumers.h
parentf1d79b587c72d41cd154c158b8f87c920c109485 (diff)
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/Frontend/ASTConsumers.h')
-rw-r--r--include/clang/Frontend/ASTConsumers.h14
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