clang API Documentation

Public Types | Public Member Functions
clang::driver::Tool Class Reference

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

#include <Tool.h>

Inheritance diagram for clang::driver::Tool:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ResponseFileSupport { RF_Full, RF_FileList, RF_None }

Public Member Functions

 Tool (const char *Name, const char *ShortName, const ToolChain &TC, ResponseFileSupport ResponseSupport=RF_None, llvm::sys::WindowsEncodingMethod ResponseEncoding=llvm::sys::WEM_UTF8, const char *ResponseFlag="@")
virtual ~Tool ()
const char * getName () const
const char * getShortName () const
const ToolChaingetToolChain () const
virtual bool hasIntegratedAssembler () const
virtual bool hasIntegratedCPP () const =0
virtual bool isLinkJob () const
virtual bool isDsymutilJob () const
ResponseFileSupport getResponseFilesSupport () const
 Returns the level of support for response files of this tool, whether it accepts arguments to be passed via a file on disk.
llvm::sys::WindowsEncodingMethod getResponseFileEncoding () const
 Returns which encoding the response file should use. This is only relevant on Windows platforms where there are different encodings being accepted for different tools. On UNIX, UTF8 is universal.
const char * getResponseFileFlag () const
 Returns which prefix to use when passing the name of a response file as a parameter to this tool.
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

Detailed Description

Tool - Information on a specific compilation tool.

Definition at line 34 of file Tool.h.


Member Enumeration Documentation

Enumerator:
RF_Full 
RF_FileList 
RF_None 

Definition at line 39 of file Tool.h.


Constructor & Destructor Documentation

Tool::Tool ( const char *  Name,
const char *  ShortName,
const ToolChain TC,
ResponseFileSupport  ResponseSupport = RF_None,
llvm::sys::WindowsEncodingMethod  ResponseEncoding = llvm::sys::WEM_UTF8,
const char *  ResponseFlag = "@" 
)

Definition at line 14 of file Tool.cpp.

Tool::~Tool ( ) [virtual]

Definition at line 22 of file Tool.cpp.


Member Function Documentation

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::CrossWindows::Link, clang::driver::tools::CrossWindows::Assemble, clang::driver::tools::XCore::Link, clang::driver::tools::XCore::Assemble, clang::driver::tools::visualstudio::Compile, clang::driver::tools::visualstudio::Link, clang::driver::tools::dragonfly::Link, clang::driver::tools::dragonfly::Assemble, clang::driver::tools::solaris::Link, clang::driver::tools::solaris::Assemble, clang::driver::tools::minix::Link, clang::driver::tools::minix::Assemble, clang::driver::tools::gnutools::Link, clang::driver::tools::gnutools::Assemble, clang::driver::tools::netbsd::Link, clang::driver::tools::netbsd::Assemble, clang::driver::tools::freebsd::Link, clang::driver::tools::freebsd::Assemble, clang::driver::tools::bitrig::Link, clang::driver::tools::bitrig::Assemble, clang::driver::tools::openbsd::Link, clang::driver::tools::openbsd::Assemble, clang::driver::tools::darwin::VerifyDebug, clang::driver::tools::darwin::Dsymutil, clang::driver::tools::darwin::Lipo, clang::driver::tools::darwin::Link, clang::driver::tools::darwin::Assemble, clang::driver::tools::hexagon::Link, clang::driver::tools::hexagon::Assemble, clang::driver::tools::gcc::Common, clang::driver::tools::ClangAs, and clang::driver::tools::Clang.

const char* clang::driver::Tool::getName ( ) const [inline]
llvm::sys::WindowsEncodingMethod clang::driver::Tool::getResponseFileEncoding ( ) const [inline]

Returns which encoding the response file should use. This is only relevant on Windows platforms where there are different encodings being accepted for different tools. On UNIX, UTF8 is universal.

Windows use cases: - GCC and Binutils on mingw only accept ANSI response files encoded with the system current code page.

  • MSVC's CL.exe and LINK.exe accept UTF16 on Windows.
  • Clang accepts both UTF8 and UTF16.

FIXME: When GNU tools learn how to parse UTF16 on Windows, we should always use UTF16 for Windows, which is the Windows official encoding for international characters.

Definition at line 107 of file Tool.h.

Referenced by clang::driver::Command::Execute().

const char* clang::driver::Tool::getResponseFileFlag ( ) const [inline]

Returns which prefix to use when passing the name of a response file as a parameter to this tool.

Definition at line 112 of file Tool.h.

Referenced by clang::driver::Command::setResponseFile().

Returns the level of support for response files of this tool, whether it accepts arguments to be passed via a file on disk.

Definition at line 92 of file Tool.h.

Referenced by clang::driver::Command::Print().

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

Definition at line 82 of file Tool.h.

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

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

Definition at line 84 of file Tool.h.

Referenced by clang::driver::FallbackCommand::Execute().

virtual bool clang::driver::Tool::hasGoodDiagnostics ( ) const [inline, virtual]

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

Reimplemented in clang::driver::tools::gcc::Compile, clang::driver::tools::gcc::Preprocess, clang::driver::tools::ClangAs, and clang::driver::tools::Clang.

Definition at line 116 of file Tool.h.

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

virtual bool clang::driver::Tool::hasIntegratedAssembler ( ) const [inline, virtual]
virtual bool clang::driver::Tool::hasIntegratedCPP ( ) const [pure virtual]
virtual bool clang::driver::Tool::isDsymutilJob ( ) const [inline, virtual]
virtual bool clang::driver::Tool::isLinkJob ( ) const [inline, virtual]

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