clang 20.0.0git
Public Member Functions | List of all members
clang::tooling::ToolInvocation Class Reference

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
 
ToolInvocationoperator= (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.
 

Detailed Description

Utility to run a FrontendAction in a single clang invocation.

Definition at line 239 of file Tooling.h.

Constructor & Destructor Documentation

◆ ToolInvocation() [1/3]

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.

Parameters
CommandLineThe 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.
FActionThe action to be executed.
FilesThe FileManager used for the execution. Class does not take ownership.
PCHContainerOpsThe PCHContainerOperations for loading and creating clang modules.

Definition at line 358 of file Tooling.cpp.

◆ ToolInvocation() [2/3]

ToolInvocation::ToolInvocation ( std::vector< std::string >  CommandLine,
ToolAction Action,
FileManager Files,
std::shared_ptr< PCHContainerOperations PCHContainerOps 
)

Create a tool invocation.

Parameters
CommandLineThe command line arguments to clang.
ActionThe action to be executed.
FilesThe FileManager used for the execution.
PCHContainerOpsThe PCHContainerOperations for loading and creating clang modules.

Definition at line 352 of file Tooling.cpp.

◆ ~ToolInvocation()

ToolInvocation::~ToolInvocation ( )

Definition at line 367 of file Tooling.cpp.

◆ ToolInvocation() [3/3]

clang::tooling::ToolInvocation::ToolInvocation ( const ToolInvocation )
delete

Member Function Documentation

◆ operator=()

ToolInvocation & clang::tooling::ToolInvocation::operator= ( const ToolInvocation )
delete

◆ run()

bool ToolInvocation::run ( )

◆ setDiagnosticConsumer()

void clang::tooling::ToolInvocation::setDiagnosticConsumer ( DiagnosticConsumer DiagConsumer)
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().

◆ setDiagnosticOptions()

void clang::tooling::ToolInvocation::setDiagnosticOptions ( DiagnosticOptions DiagOpts)
inline

Set a DiagnosticOptions to use during driver command-line parsing.

Definition at line 280 of file Tooling.h.

Referenced by createAndRunToolInvocation().


The documentation for this class was generated from the following files: