clang API Documentation

Frontend/ASTConsumers.h
Go to the documentation of this file.
00001 //===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // AST Consumers.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
00015 #define LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
00016 
00017 #include "clang/Basic/LLVM.h"
00018 
00019 #include <memory>
00020 
00021 namespace clang {
00022 
00023 class ASTConsumer;
00024 class CodeGenOptions;
00025 class DiagnosticsEngine;
00026 class FileManager;
00027 class LangOptions;
00028 class Preprocessor;
00029 class TargetOptions;
00030 
00031 // AST pretty-printer: prints out the AST in a format that is close to the
00032 // original C code.  The output is intended to be in a format such that
00033 // clang could re-parse the output back into the same AST, but the
00034 // implementation is still incomplete.
00035 std::unique_ptr<ASTConsumer> CreateASTPrinter(raw_ostream *OS,
00036                                               StringRef FilterString);
00037 
00038 // AST dumper: dumps the raw AST in human-readable form to stderr; this is
00039 // intended for debugging.
00040 std::unique_ptr<ASTConsumer> CreateASTDumper(StringRef FilterString,
00041                                              bool DumpDecls,
00042                                              bool DumpLookups);
00043 
00044 // AST Decl node lister: prints qualified names of all filterable AST Decl
00045 // nodes.
00046 std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister();
00047 
00048 // Graphical AST viewer: for each function definition, creates a graph of
00049 // the AST and displays it with the graph viewer "dotty".  Also outputs
00050 // function declarations to stderr.
00051 std::unique_ptr<ASTConsumer> CreateASTViewer();
00052 
00053 // DeclContext printer: prints out the DeclContext tree in human-readable form
00054 // to stderr; this is intended for debugging.
00055 std::unique_ptr<ASTConsumer> CreateDeclContextPrinter();
00056 
00057 } // end clang namespace
00058 
00059 #endif