diff options
| author | Alexander Kornienko <alexfh@google.com> | 2012-07-26 16:01:23 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2012-07-26 16:01:23 +0000 |
| commit | e34a052d642ba7830174b1a51787251d7f704f80 (patch) | |
| tree | 71c76fe49f288ddb5986ad1d8c3abe33a92e3f03 /include | |
| parent | bae11d8f82378f3b5ffcc994d8b107c9fbec6c4e (diff) | |
| download | clang-e34a052d642ba7830174b1a51787251d7f704f80.tar.gz clang-e34a052d642ba7830174b1a51787251d7f704f80.tar.bz2 clang-e34a052d642ba7830174b1a51787251d7f704f80.tar.xz | |
Added -ast-dump-filter option to clang -cc1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/clang/AST/DeclBase.h | 5 | ||||
| -rw-r--r-- | include/clang/Driver/CC1Options.td | 4 | ||||
| -rw-r--r-- | include/clang/Frontend/ASTConsumers.h | 4 | ||||
| -rw-r--r-- | include/clang/Frontend/FrontendOptions.h | 3 |
4 files changed, 11 insertions, 5 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index b1f9180e05..b304f1ff3e 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -857,9 +857,8 @@ public: static void printGroup(Decl** Begin, unsigned NumDecls, raw_ostream &Out, const PrintingPolicy &Policy, unsigned Indentation = 0); - LLVM_ATTRIBUTE_USED void dump() const; - LLVM_ATTRIBUTE_USED void dumpXML() const; - void dumpXML(raw_ostream &OS) const; + LLVM_ATTRIBUTE_USED void dump(raw_ostream &Out = llvm::errs()) const; + LLVM_ATTRIBUTE_USED void dumpXML(raw_ostream &OS = llvm::errs()) const; private: void setAttrsImpl(const AttrVec& Attrs, ASTContext &Ctx); diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 8fd3166ebe..48d143d2e1 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -286,6 +286,10 @@ def resource_dir : Separate<"-resource-dir">, HelpText<"The directory which holds the compiler resource files">; def version : Flag<"-version">, HelpText<"Print the compiler version">; +def ast_dump_filter : Separate<"-ast-dump-filter">, + MetaVarName<"<dump_filter>">, + HelpText<"Use with -ast-dump or -ast-print to dump/print only AST declaration" + " nodes having a certain substring in a qualified name.">; let Group = Action_Group in { diff --git a/include/clang/Frontend/ASTConsumers.h b/include/clang/Frontend/ASTConsumers.h index cef9509a97..eebdfb8dc2 100644 --- a/include/clang/Frontend/ASTConsumers.h +++ b/include/clang/Frontend/ASTConsumers.h @@ -33,11 +33,11 @@ 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); +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(); +ASTConsumer *CreateASTDumper(StringRef FilterString); // AST XML-dumper: dumps out the AST to stderr in a very detailed XML // format; this is intended for particularly intense debugging. diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h index 22cce9cc37..5d674caca5 100644 --- a/include/clang/Frontend/FrontendOptions.h +++ b/include/clang/Frontend/FrontendOptions.h @@ -141,6 +141,9 @@ public: /// If given, the new suffix for fix-it rewritten files. std::string FixItSuffix; + /// If given, filter dumped AST Decl nodes by this substring. + std::string ASTDumpFilter; + /// If given, enable code completion at the provided location. ParsedSourceLocation CodeCompletionAt; |
