clang API Documentation

Classes | Namespaces | Functions
Tooling.h File Reference
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LLVM.h"
#include "clang/Driver/Util.h"
#include "clang/Frontend/FrontendAction.h"
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Twine.h"
#include <memory>
#include <string>
#include <vector>
Include dependency graph for Tooling.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  clang::tooling::ToolAction
 Interface to process a clang::CompilerInvocation. More...
class  clang::tooling::FrontendActionFactory
 Interface to generate clang::FrontendActions. More...
class  clang::tooling::SourceFileCallbacks
 Callbacks called before and after each source file processed by a FrontendAction created by the FrontedActionFactory returned by newFrontendActionFactory. More...
class  clang::tooling::ToolInvocation
 Utility to run a FrontendAction in a single clang invocation. More...
class  clang::tooling::ClangTool
 Utility to run a FrontendAction over a set of files. More...

Namespaces

namespace  clang
namespace  clang::driver
namespace  clang::tooling

Functions

template<typename T >
std::unique_ptr
< FrontendActionFactory > 
clang::tooling::newFrontendActionFactory ()
 Returns a new FrontendActionFactory for a given type.
template<typename FactoryT >
std::unique_ptr
< FrontendActionFactory > 
clang::tooling::newFrontendActionFactory (FactoryT *ConsumerFactory, SourceFileCallbacks *Callbacks=nullptr)
 Returns a new FrontendActionFactory for any type that provides an implementation of newASTConsumer().
bool clang::tooling::runToolOnCode (clang::FrontendAction *ToolAction, const Twine &Code, const Twine &FileName="input.cc")
 Runs (and deletes) the tool on 'Code' with the -fsyntax-only flag.
bool clang::tooling::runToolOnCodeWithArgs (clang::FrontendAction *ToolAction, const Twine &Code, const std::vector< std::string > &Args, const Twine &FileName="input.cc")
 Runs (and deletes) the tool on 'Code' with the -fsyntax-only flag and with additional other flags.
std::unique_ptr< ASTUnit > clang::tooling::buildASTFromCode (const Twine &Code, const Twine &FileName="input.cc")
 Builds an AST for 'Code'.
std::unique_ptr< ASTUnit > clang::tooling::buildASTFromCodeWithArgs (const Twine &Code, const std::vector< std::string > &Args, const Twine &FileName="input.cc")
 Builds an AST for 'Code' with additional flags.
std::string clang::tooling::getAbsolutePath (StringRef File)
 Returns the absolute path of File, by prepending it with the current directory if File is not absolute.