clang  5.0.0
Namespaces | Macros | Functions
Tooling.cpp File Reference
#include "clang/Tooling/Tooling.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Tooling/ArgumentsAdjusters.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <utility>
Include dependency graph for Tooling.cpp:

Go to the source code of this file.

Namespaces

 clang
 /file This file defines classes for searching and anlyzing source code clones.
 
 clang::tooling
 

Macros

#define DEBUG_TYPE   "clang-tooling"
 

Functions

static clang::driver::Driverclang::tooling::newDriver (clang::DiagnosticsEngine *Diagnostics, const char *BinaryName, IntrusiveRefCntPtr< vfs::FileSystem > VFS)
 Builds a clang driver initialized for running clang tools. More...
 
static const
llvm::opt::ArgStringList * 
clang::tooling::getCC1Arguments (clang::DiagnosticsEngine *Diagnostics, clang::driver::Compilation *Compilation)
 Retrieves the clang CC1 specific flags out of the compilation's jobs. More...
 
clang::CompilerInvocationclang::tooling::newInvocation (clang::DiagnosticsEngine *Diagnostics, const llvm::opt::ArgStringList &CC1Args)
 Creates a CompilerInvocation. More...
 
bool clang::tooling::runToolOnCode (clang::FrontendAction *ToolAction, const Twine &Code, const Twine &FileName="input.cc", std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >())
 Runs (and deletes) the tool on 'Code' with the -fsyntax-only flag. More...
 
static std::vector< std::string > clang::tooling::getSyntaxOnlyToolArgs (const Twine &ToolName, const std::vector< std::string > &ExtraArgs, StringRef FileName)
 
bool clang::tooling::runToolOnCodeWithArgs (clang::FrontendAction *ToolAction, const Twine &Code, const std::vector< std::string > &Args, const Twine &FileName="input.cc", const Twine &ToolName="clang-tool", std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >(), const FileContentMappings &VirtualMappedFiles=FileContentMappings())
 Runs (and deletes) the tool on 'Code' with the -fsyntax-only flag and with additional other flags. More...
 
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. More...
 
void clang::tooling::addTargetAndModeForProgramName (std::vector< std::string > &CommandLine, StringRef InvokedAs)
 Changes CommandLine to contain implicit flags that would have been defined had the compiler driver been invoked through the path InvokedAs. More...
 
static void clang::tooling::injectResourceDir (CommandLineArguments &Args, const char *Argv0, void *MainAddr)
 
std::unique_ptr< ASTUnit > clang::tooling::buildASTFromCode (const Twine &Code, const Twine &FileName="input.cc", std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >())
 Builds an AST for 'Code'. More...
 
std::unique_ptr< ASTUnit > clang::tooling::buildASTFromCodeWithArgs (const Twine &Code, const std::vector< std::string > &Args, const Twine &FileName="input.cc", const Twine &ToolName="clang-tool", std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >(), ArgumentsAdjuster Adjuster=getClangStripDependencyFileAdjuster())
 Builds an AST for 'Code' with additional flags. More...
 

Macro Definition Documentation

#define DEBUG_TYPE   "clang-tooling"

Definition at line 39 of file Tooling.cpp.

Variable Documentation

FrontendAction* Action

Definition at line 205 of file Tooling.cpp.

Referenced by clang::Sema::ActOnPragmaOptionsAlign(), clang::tooling::buildASTFromCodeWithArgs(), clang::tooling::ClangTool::buildASTs(), CreateFrontendBaseAction(), CleanupTy::Emit(), clang::CodeGen::emitCriticalRegion(), clang::CodeGen::emitMasterRegion(), clang::CodeGen::CodeGenFunction::EmitOMPCriticalDirective(), clang::CodeGen::CodeGenFunction::EmitOMPMasterDirective(), clang::CodeGen::CodeGenFunction::EmitOMPOrderedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPSingleDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDataDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetParallelDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDeviceFunction(), clang::CodeGen::CodeGenFunction::EmitOMPTargetTeamsDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskBasedDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskgroupDirective(), clang::CodeGen::CodeGenFunction::EmitOMPTaskLoopBasedDirective(), clang::CodeGen::emitOrderedRegion(), clang::CodeGen::CGOpenMPRuntimeNVPTX::emitReduction(), clang::CodeGen::emitTaskCall(), clang::CodeGen::emitTaskgroupRegion(), clang::CodeGen::emitTaskOutlinedFunction(), clang::BackendConsumer::HandleTranslationUnit(), clang::ASTUnit::LoadFromCompilerInvocationAction(), clang::CodeGen::RegionCodeGenTy::operator()(), clang::Sema::PerformImplicitConversion(), clang::Sema::RefersToMemberWithReducedAlignment(), clang::CodeGen::RegionCodeGenTy::setAction(), and clang::RewriteIncludesAction::RewriteImportsListener::visitModuleFile().

std::vector<std::unique_ptr<ASTUnit> >& ASTs