clang 20.0.0git
|
Utility to run a FrontendAction in a single clang invocation. More...
#include "clang/Tooling/Tooling.h"
Public Member Functions | |
ToolInvocation (std::vector< std::string > CommandLine, std::unique_ptr< FrontendAction > FAction, FileManager *Files, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >()) | |
Create a tool invocation. | |
ToolInvocation (std::vector< std::string > CommandLine, ToolAction *Action, FileManager *Files, std::shared_ptr< PCHContainerOperations > PCHContainerOps) | |
Create a tool invocation. | |
~ToolInvocation () | |
ToolInvocation (const ToolInvocation &)=delete | |
ToolInvocation & | operator= (const ToolInvocation &)=delete |
void | setDiagnosticConsumer (DiagnosticConsumer *DiagConsumer) |
Set a DiagnosticConsumer to use during driver command-line parsing and the action invocation itself. | |
void | setDiagnosticOptions (DiagnosticOptions *DiagOpts) |
Set a DiagnosticOptions to use during driver command-line parsing. | |
bool | run () |
Run the clang invocation. | |
Utility to run a FrontendAction in a single clang invocation.
ToolInvocation::ToolInvocation | ( | std::vector< std::string > | CommandLine, |
std::unique_ptr< FrontendAction > | FAction, | ||
FileManager * | Files, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps = std::make_shared<PCHContainerOperations>() |
||
) |
Create a tool invocation.
CommandLine | The command line arguments to clang. Note that clang uses its binary name (CommandLine[0]) to locate its builtin headers. Callers have to ensure that they are installed in a compatible location (see clang driver implementation) or mapped in via mapVirtualFile. |
FAction | The action to be executed. |
Files | The FileManager used for the execution. Class does not take ownership. |
PCHContainerOps | The PCHContainerOperations for loading and creating clang modules. |
Definition at line 358 of file Tooling.cpp.
ToolInvocation::ToolInvocation | ( | std::vector< std::string > | CommandLine, |
ToolAction * | Action, | ||
FileManager * | Files, | ||
std::shared_ptr< PCHContainerOperations > | PCHContainerOps | ||
) |
Create a tool invocation.
CommandLine | The command line arguments to clang. |
Action | The action to be executed. |
Files | The FileManager used for the execution. |
PCHContainerOps | The PCHContainerOperations for loading and creating clang modules. |
Definition at line 352 of file Tooling.cpp.
ToolInvocation::~ToolInvocation | ( | ) |
Definition at line 367 of file Tooling.cpp.
|
delete |
|
delete |
bool ToolInvocation::run | ( | ) |
Run the clang invocation.
Definition at line 372 of file Tooling.cpp.
References clang::CreateAndPopulateDiagOpts(), clang::CompilerInstance::createDiagnostics(), clang::tooling::getCC1Arguments(), clang::FileManager::getFileSystemOpts(), clang::FileManager::getVirtualFileSystem(), newDriver(), clang::tooling::newInvocation(), clang::tooling::ToolAction::runInvocation(), and clang::FileSystemOptions::WorkingDir.
Referenced by clang::tooling::buildASTFromCodeWithArgs(), createAndRunToolInvocation(), clang::tooling::ClangTool::run(), and clang::tooling::runToolOnCodeWithArgs().
|
inline |
Set a DiagnosticConsumer
to use during driver command-line parsing and the action invocation itself.
Definition at line 275 of file Tooling.h.
Referenced by clang::tooling::buildASTFromCodeWithArgs(), createAndRunToolInvocation(), and clang::tooling::ClangTool::run().
|
inline |
Set a DiagnosticOptions
to use during driver command-line parsing.
Definition at line 280 of file Tooling.h.
Referenced by createAndRunToolInvocation().