clang 10.0.0git

Public Member Functions | Static Public Attributes | List of all members
clang::tooling::AllTUsToolExecutor Class Reference

Executes given frontend actions on all files/TUs in the compilation database. More...

`#include "clang/Tooling/AllTUsExecution.h"`

Inheritance diagram for clang::tooling::AllTUsToolExecutor:
[legend]
Collaboration diagram for clang::tooling::AllTUsToolExecutor:
[legend]

## Public Member Functions
| AllTUsToolExecutor (const CompilationDatabase &Compilations, unsigned ThreadCount, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >())
| Init with `CompilationDatabase`. More...
| AllTUsToolExecutor (CommonOptionsParser Options, unsigned ThreadCount, std::shared_ptr< PCHContainerOperations > PCHContainerOps=std::make_shared< PCHContainerOperations >())
| Init with `CommonOptionsParser`. More...
StringRef | getExecutorName () const override
| Returns the name of a specific executor. More...
llvm::Error | execute (llvm::ArrayRef< std::pair< std::unique_ptr< FrontendActionFactory >, ArgumentsAdjuster >> Actions) override
| Executes each action with a corresponding arguments adjuster. More...
ExecutionContext * | getExecutionContext () override
| Returns a reference to the execution context. More...
ToolResults * | getToolResults () override
| Returns a reference to the result container. More...
void | mapVirtualFile (StringRef FilePath, StringRef Content) override
| Map a virtual file to be used while running the tool. More...
Public Member Functions inherited from clang::tooling::ToolExecutor
virtual | ~ToolExecutor ()
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action)
| Convenient functions for the above `execute`. More...
llvm::Error | execute (std::unique_ptr< FrontendActionFactory > Action, ArgumentsAdjuster Adjuster)
| Executes an action with an argument adjuster. More...

## Static Public Attributes
static const char * | ExecutorName = "AllTUsToolExecutor"

## Detailed Description

Executes given frontend actions on all files/TUs in the compilation database.

Definition at line 25 of file AllTUsExecution.h.

## Constructor & Destructor Documentation

## ◆ AllTUsToolExecutor() [1/2]

clang::tooling::AllTUsToolExecutor::AllTUsToolExecutor | ( | const CompilationDatabase & | Compilations,
|  | unsigned | ThreadCount,
|  | std::shared_ptr< PCHContainerOperations > | PCHContainerOps = `std::make_shared<PCHContainerOperations>()`
| ) |  |

Init with `CompilationDatabase`.

This uses `ThreadCount` threads to exececute the actions on all files in parallel. If `ThreadCount` is 0, this uses `llvm::hardware_concurrency`.

Definition at line 63 of file AllTUsExecution.cpp.

## ◆ AllTUsToolExecutor() [2/2]

clang::tooling::AllTUsToolExecutor::AllTUsToolExecutor | ( | CommonOptionsParser | Options,
|  | unsigned | ThreadCount,
|  | std::shared_ptr< PCHContainerOperations > | PCHContainerOps = `std::make_shared<PCHContainerOperations>()`
| ) |  |

Init with `CommonOptionsParser`.

This is expected to be used by `createExecutorFromCommandLineArgs` based on commandline options.

The executor takes ownership of `Options`.

Definition at line 69 of file AllTUsExecution.cpp.

## Member Function Documentation

## ◆ execute()

llvm::Error clang::tooling::AllTUsToolExecutor::execute | ( | llvm::ArrayRef< std::pair< std::unique_ptr< FrontendActionFactory >, ArgumentsAdjuster >> | Actions | ) |
| override virtual

Executes each action with a corresponding arguments adjuster.

Implements clang::tooling::ToolExecutor.

Definition at line 77 of file AllTUsExecution.cpp.

References clang::tooling::Filter, clang::tooling::CompilationDatabase::getAllFiles(), and clang::tooling::make_string_error().

Referenced by getExecutorName().

## ◆ getExecutionContext()

ExecutionContext* clang::tooling::AllTUsToolExecutor::getExecutionContext | ( |  | ) |
| inline override virtual

Returns a reference to the execution context.

This should be passed to tool callbacks, and tool callbacks should report results via the returned context.

Implements clang::tooling::ToolExecutor.

Definition at line 54 of file AllTUsExecution.h.

## ◆ getExecutorName()

StringRef clang::tooling::AllTUsToolExecutor::getExecutorName | ( |  | ) | const
| inline override virtual

Returns the name of a specific executor.

Implements clang::tooling::ToolExecutor.

Definition at line 45 of file AllTUsExecution.h.

References clang::Error, execute(), clang::tooling::ToolExecutor::execute(), and ExecutorName.

## ◆ getToolResults()

ToolResults* clang::tooling::AllTUsToolExecutor::getToolResults | ( |  | ) |
| inline override virtual

Returns a reference to the result container.

NOTE: This should only be used after the execution finishes. Tool callbacks should report results via `ExecutionContext` instead.

Implements clang::tooling::ToolExecutor.

Definition at line 56 of file AllTUsExecution.h.

## ◆ mapVirtualFile()

void clang::tooling::AllTUsToolExecutor::mapVirtualFile | ( | StringRef | FilePath,
|  | StringRef | Content
| ) |  |
| inline override virtual

Map a virtual file to be used while running the tool.

Parameters

  FilePath | The path at which the content will be mapped.
  Content | A buffer of the file's content.

Implements clang::tooling::ToolExecutor.

Definition at line 58 of file AllTUsExecution.h.

References clang::tooling::ExecutorConcurrency, and clang::tooling::Filter.

## Member Data Documentation

## ◆ ExecutorName

const char * clang::tooling::AllTUsToolExecutor::ExecutorName = "AllTUsToolExecutor"
| static

Definition at line 27 of file AllTUsExecution.h.

Referenced by getExecutorName().

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

- include/clang/Tooling/AllTUsExecution.h
- lib/Tooling/AllTUsExecution.cpp