Lines Matching +full:clang +full:- +full:format
1 //===--- ASTConsumers.cpp - ASTConsumer implementations -------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #include "clang/Frontend/ASTConsumers.h"
14 #include "clang/AST/AST.h"
15 #include "clang/AST/ASTConsumer.h"
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/PrettyPrinter.h"
18 #include "clang/AST/RecordLayout.h"
19 #include "clang/AST/RecursiveASTVisitor.h"
20 #include "clang/Basic/Diagnostic.h"
21 #include "clang/Basic/SourceManager.h"
25 using namespace clang;
27 //===----------------------------------------------------------------------===//
28 /// ASTPrinter - Pretty-printer and dumper of ASTs
38 ASTDumpOutputFormat Format, StringRef FilterString, in ASTPrinter() argument
41 OutputKind(K), OutputFormat(Format), FilterString(FilterString), in ASTPrinter()
78 return cast<NamedDecl>(D)->getQualifiedNameAsString(); in getName()
87 if (DC == DC->getPrimaryContext()) in print()
88 DC->dumpLookups(Out, OutputKind != None, OutputKind == DumpFull); in print()
91 << DC->getPrimaryContext() << "\n"; in print()
95 PrintingPolicy Policy(D->getASTContext().getLangOpts()); in print()
96 D->print(Out, Policy, /*Indentation=*/0, /*PrintInstantiation=*/true); in print()
98 D->dump(Out, OutputKind == DumpFull, OutputFormat); in print()
104 InnerD = TD->getTemplatedDecl(); in print()
107 // FIXME: Support combining -ast-dump-decl-types with -ast-dump-lookups. in print()
109 VD->getType().dump(Out, VD->getASTContext()); in print()
111 TD->getTypeForDecl()->dump(Out, TD->getASTContext()); in print()
121 /// What format should the output take?
128 /// results will be output with a format determined by OutputKind. This is
149 D->printQualifiedName(Out); in VisitNamedDecl()
160 clang::CreateASTPrinter(std::unique_ptr<raw_ostream> Out, in CreateASTPrinter()
167 clang::CreateASTDumper(std::unique_ptr<raw_ostream> Out, StringRef FilterString, in CreateASTDumper()
169 bool DumpDeclTypes, ASTDumpOutputFormat Format) { in CreateASTDumper() argument
175 Format, FilterString, DumpLookups, DumpDeclTypes); in CreateASTDumper()
178 std::unique_ptr<ASTConsumer> clang::CreateASTDeclNodeLister() { in CreateASTDeclNodeLister()
182 //===----------------------------------------------------------------------===//
183 /// ASTViewer - AST Visualization
190 void Initialize(ASTContext &Context) override { this->Context = &Context; } in Initialize()
204 D->print(llvm::errs()); in HandleTopLevelSingleDecl()
206 if (Stmt *Body = D->getBody()) { in HandleTopLevelSingleDecl()
208 Body->viewAST(); in HandleTopLevelSingleDecl()
214 std::unique_ptr<ASTConsumer> clang::CreateASTViewer() { in CreateASTViewer()