clang 20.0.0git
Public Member Functions | List of all members
clang::driver::Tool Class Referenceabstract

Tool - Information on a specific compilation tool. More...

#include "clang/Driver/Tool.h"

Inherited by clang::driver::tools::AMDGCN::Linker, clang::driver::tools::AVR::Linker, clang::driver::tools::CSKY::Linker, clang::driver::tools::Clang, clang::driver::tools::ClangAs, clang::driver::tools::CrossWindows::Assembler, clang::driver::tools::CrossWindows::Linker, clang::driver::tools::Flang, clang::driver::tools::HIPSPV::Linker, clang::driver::tools::LinkerWrapper, clang::driver::tools::MinGW::Assembler, clang::driver::tools::MinGW::Linker, clang::driver::tools::NVPTX::Assembler, clang::driver::tools::NVPTX::FatBinary, clang::driver::tools::NVPTX::Linker, clang::driver::tools::OffloadBundler, clang::driver::tools::OffloadPackager, clang::driver::tools::PS4cpu::Linker, clang::driver::tools::PS5cpu::Linker, clang::driver::tools::PScpu::Assembler, clang::driver::tools::RISCV::Linker, clang::driver::tools::SPIRV::Linker, clang::driver::tools::SPIRV::Translator, clang::driver::tools::XCore::Assembler, clang::driver::tools::XCore::Linker, clang::driver::tools::aix::Assembler, clang::driver::tools::aix::Linker, clang::driver::tools::amdgpu::Linker, clang::driver::tools::baremetal::Linker, clang::driver::tools::baremetal::StaticLibTool, clang::driver::tools::darwin::MachOTool, clang::driver::tools::dragonfly::Assembler, clang::driver::tools::dragonfly::Linker, clang::driver::tools::freebsd::Assembler, clang::driver::tools::freebsd::Linker, clang::driver::tools::fuchsia::Linker, clang::driver::tools::fuchsia::StaticLibTool, clang::driver::tools::gcc::Common, clang::driver::tools::gnutools::Assembler, clang::driver::tools::gnutools::Linker, clang::driver::tools::gnutools::StaticLibTool, clang::driver::tools::haiku::Linker, clang::driver::tools::hexagon::Assembler, clang::driver::tools::hexagon::Linker, clang::driver::tools::hlsl::Validator, clang::driver::tools::ifstool::Merger, clang::driver::tools::msp430::Linker, clang::driver::tools::nacltools::Linker, clang::driver::tools::netbsd::Assembler, clang::driver::tools::netbsd::Linker, clang::driver::tools::openbsd::Assembler, clang::driver::tools::openbsd::Linker, clang::driver::tools::solaris::Linker, clang::driver::tools::visualstudio::Linker, clang::driver::tools::wasm::Linker, clang::driver::tools::zos::Assembler, and clang::driver::tools::zos::Linker.

Public Member Functions

 Tool (const char *Name, const char *ShortName, const ToolChain &TC)
 
virtual ~Tool ()
 
const char * getName () const
 
const char * getShortName () const
 
const ToolChaingetToolChain () const
 
virtual bool hasIntegratedAssembler () const
 
virtual bool hasIntegratedBackend () const
 
virtual bool canEmitIR () const
 
virtual bool hasIntegratedCPP () const =0
 
virtual bool isLinkJob () const
 
virtual bool isDsymutilJob () const
 
virtual bool hasGoodDiagnostics () const
 Does this tool have "good" standardized diagnostics, or should the driver add an additional "command failed" diagnostic on failures.
 
virtual void ConstructJob (Compilation &C, const JobAction &JA, const InputInfo &Output, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const =0
 ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs, and add the jobs to C.
 
virtual void ConstructJobMultipleOutputs (Compilation &C, const JobAction &JA, const InputInfoList &Outputs, const InputInfoList &Inputs, const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const
 Construct jobs to perform the action JA, writing to the Outputs and with Inputs, and add the jobs to C.
 

Detailed Description

Tool - Information on a specific compilation tool.

Definition at line 32 of file Tool.h.

Constructor & Destructor Documentation

◆ Tool()

Tool::Tool ( const char *  Name,
const char *  ShortName,
const ToolChain TC 
)

Definition at line 14 of file Tool.cpp.

◆ ~Tool()

Tool::~Tool ( )
virtual

Definition at line 17 of file Tool.cpp.

Member Function Documentation

◆ canEmitIR()

virtual bool clang::driver::Tool::canEmitIR ( ) const
inlinevirtual

Reimplemented in clang::driver::tools::Clang, and clang::driver::tools::Flang.

Definition at line 56 of file Tool.h.

◆ ConstructJob()

virtual void clang::driver::Tool::ConstructJob ( Compilation C,
const JobAction JA,
const InputInfo Output,
const InputInfoList Inputs,
const llvm::opt::ArgList &  TCArgs,
const char *  LinkingOutput 
) const
pure virtual

ConstructJob - Construct jobs to perform the action JA, writing to Output and with Inputs, and add the jobs to C.

Parameters
TCArgs- The argument list for this toolchain, with any tool chain specific translations applied.
LinkingOutput- If this output will eventually feed the linker, then this is the final output name of the linked image.

Implemented in clang::driver::tools::aix::Assembler, clang::driver::tools::aix::Linker, clang::driver::tools::amdgpu::Linker, clang::driver::tools::AVR::Linker, clang::driver::tools::baremetal::StaticLibTool, clang::driver::tools::baremetal::Linker, clang::driver::tools::Clang, clang::driver::tools::ClangAs, clang::driver::tools::OffloadBundler, clang::driver::tools::OffloadPackager, clang::driver::tools::LinkerWrapper, clang::driver::tools::CrossWindows::Assembler, clang::driver::tools::CrossWindows::Linker, clang::driver::tools::CSKY::Linker, clang::driver::tools::NVPTX::Assembler, clang::driver::tools::NVPTX::FatBinary, clang::driver::tools::NVPTX::Linker, clang::driver::tools::darwin::Assembler, clang::driver::tools::darwin::Linker, clang::driver::tools::darwin::StaticLibTool, clang::driver::tools::darwin::Lipo, clang::driver::tools::darwin::Dsymutil, clang::driver::tools::darwin::VerifyDebug, clang::driver::tools::dragonfly::Assembler, clang::driver::tools::dragonfly::Linker, clang::driver::tools::Flang, clang::driver::tools::freebsd::Assembler, clang::driver::tools::freebsd::Linker, clang::driver::tools::fuchsia::StaticLibTool, clang::driver::tools::fuchsia::Linker, clang::driver::tools::gnutools::Assembler, clang::driver::tools::gnutools::Linker, clang::driver::tools::gnutools::StaticLibTool, clang::driver::tools::gcc::Common, clang::driver::tools::haiku::Linker, clang::driver::tools::hexagon::Assembler, clang::driver::tools::hexagon::Linker, clang::driver::tools::AMDGCN::Linker, clang::driver::tools::HIPSPV::Linker, clang::driver::tools::hlsl::Validator, clang::driver::tools::ifstool::Merger, clang::driver::tools::MinGW::Assembler, clang::driver::tools::MinGW::Linker, clang::driver::tools::msp430::Linker, clang::driver::tools::visualstudio::Linker, clang::driver::tools::nacltools::AssemblerARM, clang::driver::tools::nacltools::Linker, clang::driver::tools::netbsd::Assembler, clang::driver::tools::netbsd::Linker, clang::driver::tools::openbsd::Assembler, clang::driver::tools::openbsd::Linker, clang::driver::tools::PScpu::Assembler, clang::driver::tools::PS4cpu::Linker, clang::driver::tools::PS5cpu::Linker, clang::driver::tools::RISCV::Linker, clang::driver::tools::solaris::Assembler, clang::driver::tools::solaris::Linker, clang::driver::tools::SPIRV::Translator, clang::driver::tools::SPIRV::Linker, clang::driver::tools::wasm::Linker, clang::driver::tools::XCore::Assembler, clang::driver::tools::XCore::Linker, clang::driver::tools::zos::Assembler, and clang::driver::tools::zos::Linker.

Referenced by clang::driver::tools::LinkerWrapper::ConstructJob(), and ConstructJobMultipleOutputs().

◆ ConstructJobMultipleOutputs()

void Tool::ConstructJobMultipleOutputs ( Compilation C,
const JobAction JA,
const InputInfoList Outputs,
const InputInfoList Inputs,
const llvm::opt::ArgList &  TCArgs,
const char *  LinkingOutput 
) const
virtual

Construct jobs to perform the action JA, writing to the Outputs and with Inputs, and add the jobs to C.

The default implementation assumes a single output and is expected to be overloaded for the tools that support multiple inputs.

Parameters
TCArgsThe argument list for this toolchain, with any tool chain specific translations applied.
LinkingOutputIf this output will eventually feed the linker, then this is the final output name of the linked image.

Reimplemented in clang::driver::tools::OffloadBundler.

Definition at line 20 of file Tool.cpp.

References clang::C, and ConstructJob().

◆ getName()

const char * clang::driver::Tool::getName ( ) const
inline

Definition at line 48 of file Tool.h.

◆ getShortName()

const char * clang::driver::Tool::getShortName ( ) const
inline

◆ getToolChain()

const ToolChain & clang::driver::Tool::getToolChain ( ) const
inline

Definition at line 52 of file Tool.h.

Referenced by clang::driver::tools::ClangAs::AddLoongArchTargetArgs(), clang::driver::tools::ClangAs::AddMIPSTargetArgs(), clang::driver::tools::ClangAs::AddRISCVTargetArgs(), clang::driver::tools::ClangAs::AddX86TargetArgs(), clang::driver::tools::aix::Assembler::ConstructJob(), clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::OffloadBundler::ConstructJob(), clang::driver::tools::OffloadPackager::ConstructJob(), clang::driver::tools::LinkerWrapper::ConstructJob(), clang::driver::tools::CrossWindows::Assembler::ConstructJob(), clang::driver::tools::darwin::Assembler::ConstructJob(), clang::driver::tools::dragonfly::Assembler::ConstructJob(), clang::driver::tools::Flang::ConstructJob(), clang::driver::tools::freebsd::Assembler::ConstructJob(), clang::driver::tools::fuchsia::Linker::ConstructJob(), clang::driver::tools::gcc::Common::ConstructJob(), clang::driver::tools::haiku::Linker::ConstructJob(), clang::driver::tools::hlsl::Validator::ConstructJob(), clang::driver::tools::ifstool::Merger::ConstructJob(), clang::driver::tools::MinGW::Assembler::ConstructJob(), clang::driver::tools::visualstudio::Linker::ConstructJob(), clang::driver::tools::nacltools::AssemblerARM::ConstructJob(), clang::driver::tools::netbsd::Assembler::ConstructJob(), clang::driver::tools::openbsd::Assembler::ConstructJob(), clang::driver::tools::PScpu::Assembler::ConstructJob(), clang::driver::tools::XCore::Assembler::ConstructJob(), clang::driver::tools::OffloadBundler::ConstructJobMultipleOutputs(), and clang::driver::CC1Command::Execute().

◆ hasGoodDiagnostics()

virtual bool clang::driver::Tool::hasGoodDiagnostics ( ) const
inlinevirtual

Does this tool have "good" standardized diagnostics, or should the driver add an additional "command failed" diagnostic on failures.

Reimplemented in clang::driver::tools::Clang, clang::driver::tools::ClangAs, clang::driver::tools::Flang, clang::driver::tools::gcc::Preprocessor, and clang::driver::tools::gcc::Compiler.

Definition at line 63 of file Tool.h.

Referenced by clang::driver::Driver::ExecuteCompilation().

◆ hasIntegratedAssembler()

virtual bool clang::driver::Tool::hasIntegratedAssembler ( ) const
inlinevirtual

◆ hasIntegratedBackend()

virtual bool clang::driver::Tool::hasIntegratedBackend ( ) const
inlinevirtual

Reimplemented in clang::driver::tools::Clang.

Definition at line 55 of file Tool.h.

◆ hasIntegratedCPP()

virtual bool clang::driver::Tool::hasIntegratedCPP ( ) const
pure virtual

Implemented in clang::driver::tools::aix::Assembler, clang::driver::tools::aix::Linker, clang::driver::tools::amdgpu::Linker, clang::driver::tools::AVR::Linker, clang::driver::tools::baremetal::StaticLibTool, clang::driver::tools::baremetal::Linker, clang::driver::tools::Clang, clang::driver::tools::ClangAs, clang::driver::tools::OffloadBundler, clang::driver::tools::OffloadPackager, clang::driver::tools::LinkerWrapper, clang::driver::tools::CrossWindows::Assembler, clang::driver::tools::CrossWindows::Linker, clang::driver::tools::CSKY::Linker, clang::driver::tools::NVPTX::Assembler, clang::driver::tools::NVPTX::FatBinary, clang::driver::tools::NVPTX::Linker, clang::driver::tools::darwin::Assembler, clang::driver::tools::darwin::Linker, clang::driver::tools::darwin::StaticLibTool, clang::driver::tools::darwin::Lipo, clang::driver::tools::darwin::Dsymutil, clang::driver::tools::darwin::VerifyDebug, clang::driver::tools::dragonfly::Assembler, clang::driver::tools::dragonfly::Linker, clang::driver::tools::Flang, clang::driver::tools::freebsd::Assembler, clang::driver::tools::freebsd::Linker, clang::driver::tools::fuchsia::StaticLibTool, clang::driver::tools::fuchsia::Linker, clang::driver::tools::gnutools::Assembler, clang::driver::tools::gnutools::Linker, clang::driver::tools::gnutools::StaticLibTool, clang::driver::tools::gcc::Preprocessor, clang::driver::tools::gcc::Compiler, clang::driver::tools::gcc::Linker, clang::driver::tools::haiku::Linker, clang::driver::tools::hexagon::Assembler, clang::driver::tools::hexagon::Linker, clang::driver::tools::AMDGCN::Linker, clang::driver::tools::HIPSPV::Linker, clang::driver::tools::hlsl::Validator, clang::driver::tools::ifstool::Merger, clang::driver::tools::MinGW::Assembler, clang::driver::tools::MinGW::Linker, clang::driver::tools::msp430::Linker, clang::driver::tools::visualstudio::Linker, clang::driver::tools::nacltools::Linker, clang::driver::tools::netbsd::Assembler, clang::driver::tools::netbsd::Linker, clang::driver::tools::openbsd::Assembler, clang::driver::tools::openbsd::Linker, clang::driver::tools::PScpu::Assembler, clang::driver::tools::PS4cpu::Linker, clang::driver::tools::PS5cpu::Linker, clang::driver::tools::RISCV::Linker, clang::driver::tools::solaris::Assembler, clang::driver::tools::solaris::Linker, clang::driver::tools::SPIRV::Translator, clang::driver::tools::SPIRV::Linker, clang::driver::tools::wasm::Linker, clang::driver::tools::XCore::Assembler, clang::driver::tools::XCore::Linker, clang::driver::tools::zos::Assembler, and clang::driver::tools::zos::Linker.

◆ isDsymutilJob()

virtual bool clang::driver::Tool::isDsymutilJob ( ) const
inlinevirtual

◆ isLinkJob()

virtual bool clang::driver::Tool::isLinkJob ( ) const
inlinevirtual

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