ΒΆbool runToolOnCodeWithArgs(
    std::unique_ptr<FrontendAction> ToolAction,
    const llvm::Twine& Code,
    const std::vector<std::string>& Args,
    const llvm::Twine& FileName = "input.cc",
    const llvm::Twine& ToolName = "clang-tool",
    std::shared_ptr<PCHContainerOperations>
        PCHContainerOps = std::make_shared<
            clang::PCHContainerOperations>(),
    const clang::tooling::FileContentMappings&
        VirtualMappedFiles = std::vector<
            std::pair<std::basic_string<
                          char,
                          std::char_traits<char>,
                          std::allocator<char>>,
                      std::basic_string<
                          char,
                          std::char_traits<char>,
                          std::allocator<char>>>,
            std::allocator<std::pair<
                std::basic_string<
                    char,
                    std::char_traits<char>,
                    std::allocator<char>>,
                std::basic_string<
                    char,
                    std::char_traits<char>,
                    std::allocator<char>>>>>())

Description

Runs (and deletes) the tool on 'Code' with the -fsyntax-only flag and with additional other flags.

Declared at: clang/include/clang/Tooling/Tooling.h:186

Parameters

std::unique_ptr<FrontendAction> ToolAction
The action to run over the code.
const llvm::Twine& Code
C++ code.
const std::vector<std::string>& Args
Additional flags to pass on.
const llvm::Twine& FileName = "input.cc"
The file name which 'Code' will be mapped as.
const llvm::Twine& ToolName = "clang-tool"
The name of the binary running the tool. Standard library header paths will be resolved relative to this.
std::shared_ptr<PCHContainerOperations> PCHContainerOps = std::make_shared<clang::PCHContainerOperations>()
The PCHContainerOperations for loading and creating clang modules.
const clang::tooling::FileContentMappings& VirtualMappedFiles = std::vector<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>()

Returns

- True if 'ToolAction' was successfully executed.