clang API Documentation

Public Member Functions
clang::driver::Compilation Class Reference

#include <Compilation.h>

List of all members.

Public Member Functions

 Compilation (const Driver &D, const ToolChain &DefaultToolChain, InputArgList *Args, DerivedArgList *TranslatedArgs)
 ~Compilation ()
const DrivergetDriver () const
const ToolChaingetDefaultToolChain () const
const InputArgListgetInputArgs () const
const DerivedArgListgetArgs () const
ActionListgetActions ()
const ActionListgetActions () const
JobListgetJobs ()
const JobListgetJobs () const
void addCommand (Command *C)
const ArgStringListgetTempFiles () const
const ArgStringListgetResultFiles () const
const ArgStringListgetFailureResultFiles () const
StringRef getSysRoot () const
 Returns the sysroot path.
const DerivedArgListgetArgsForToolChain (const ToolChain *TC, const char *BoundArch)
const char * addTempFile (const char *Name)
const char * addResultFile (const char *Name)
const char * addFailureResultFile (const char *Name)
bool CleanupFileList (const ArgStringList &Files, bool IssueErrors=false) const
void PrintJob (raw_ostream &OS, const Job &J, const char *Terminator, bool Quote) const
int ExecuteCommand (const Command &C, const Command *&FailingCommand) const
int ExecuteJob (const Job &J, const Command *&FailingCommand) const
void initCompilationForDiagnostics ()

Detailed Description

Compilation - A set of tasks to perform for a single driver invocation.

Definition at line 28 of file Compilation.h.


Constructor & Destructor Documentation

Compilation::Compilation ( const Driver D,
const ToolChain DefaultToolChain,
InputArgList Args,
DerivedArgList TranslatedArgs 
)

Definition at line 28 of file Compilation.cpp.

Compilation::~Compilation ( )

Definition at line 34 of file Compilation.cpp.


Member Function Documentation

void clang::driver::Compilation::addCommand ( Command C) [inline]

Definition at line 85 of file Compilation.h.

References clang::driver::JobList::addJob().

Referenced by clang::driver::tools::Clang::ConstructJob(), clang::driver::tools::ClangAs::ConstructJob(), clang::driver::tools::gcc::Common::ConstructJob(), clang::driver::tools::hexagon::Assemble::ConstructJob(), clang::driver::tools::hexagon::Link::ConstructJob(), clang::driver::tools::darwin::Preprocess::ConstructJob(), clang::driver::tools::darwin::Compile::ConstructJob(), clang::driver::tools::darwin::Assemble::ConstructJob(), clang::driver::tools::darwin::Link::ConstructJob(), clang::driver::tools::darwin::Lipo::ConstructJob(), clang::driver::tools::darwin::Dsymutil::ConstructJob(), clang::driver::tools::darwin::VerifyDebug::ConstructJob(), clang::driver::tools::openbsd::Assemble::ConstructJob(), clang::driver::tools::openbsd::Link::ConstructJob(), clang::driver::tools::freebsd::Assemble::ConstructJob(), clang::driver::tools::freebsd::Link::ConstructJob(), clang::driver::tools::netbsd::Assemble::ConstructJob(), clang::driver::tools::netbsd::Link::ConstructJob(), clang::driver::tools::linuxtools::Assemble::ConstructJob(), clang::driver::tools::linuxtools::Link::ConstructJob(), clang::driver::tools::minix::Assemble::ConstructJob(), clang::driver::tools::minix::Link::ConstructJob(), clang::driver::tools::solaris::Assemble::ConstructJob(), clang::driver::tools::solaris::Link::ConstructJob(), clang::driver::tools::auroraux::Assemble::ConstructJob(), clang::driver::tools::auroraux::Link::ConstructJob(), clang::driver::tools::dragonfly::Assemble::ConstructJob(), clang::driver::tools::dragonfly::Link::ConstructJob(), and clang::driver::tools::visualstudio::Link::ConstructJob().

const char* clang::driver::Compilation::addFailureResultFile ( const char *  Name) [inline]

addFailureResultFile - Add a file to remove if we crash, and returns its argument.

Definition at line 122 of file Compilation.h.

const char* clang::driver::Compilation::addResultFile ( const char *  Name) [inline]

addResultFile - Add a file to remove on failure, and returns its argument.

Definition at line 115 of file Compilation.h.

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

const char* clang::driver::Compilation::addTempFile ( const char *  Name) [inline]

addTempFile - Add a file to remove on exit, and returns its argument.

Definition at line 108 of file Compilation.h.

Referenced by clang::driver::tools::darwin::Compile::ConstructJob(), and clang::driver::Driver::GetNamedOutputPath().

bool Compilation::CleanupFileList ( const ArgStringList Files,
bool  IssueErrors = false 
) const

CleanupFileList - Remove the files in the given list.

Parameters:
IssueErrors- Report failures as errors.
Returns:
Whether all files were removed successfully.

Definition at line 104 of file Compilation.cpp.

References clang::driver::Driver::Diag(), getDriver(), and P.

Referenced by clang::driver::Driver::ExecuteCompilation(), and clang::driver::Driver::generateCompilationDiagnostics().

int Compilation::ExecuteCommand ( const Command C,
const Command *&  FailingCommand 
) const

ExecuteCommand - Execute an actual command.

Parameters:
FailingCommand- For non-zero results, this will be set to the Command which failed, if any.
Returns:
The result code of the subprocess.

Definition at line 140 of file Compilation.cpp.

References clang::driver::Driver::Diag(), getArgs(), clang::driver::Command::getArguments(), getDriver(), clang::driver::Command::getExecutable(), and PrintJob().

Referenced by ExecuteJob().

int Compilation::ExecuteJob ( const Job J,
const Command *&  FailingCommand 
) const

ExecuteJob - Execute a single job.

Parameters:
FailingCommand- For non-zero results, this will be set to the Command which failed.
Returns:
The accumulated result code of the job.

Definition at line 195 of file Compilation.cpp.

References clang::driver::JobList::begin(), clang::driver::JobList::end(), and ExecuteCommand().

Referenced by clang::driver::Driver::ExecuteCompilation(), and clang::driver::Driver::generateCompilationDiagnostics().

ActionList& clang::driver::Compilation::getActions ( ) [inline]
const ActionList& clang::driver::Compilation::getActions ( ) const [inline]

Definition at line 80 of file Compilation.h.

const DerivedArgList& clang::driver::Compilation::getArgs ( ) const [inline]
const DerivedArgList & Compilation::getArgsForToolChain ( const ToolChain TC,
const char *  BoundArch 
)

getArgsForToolChain - Return the derived argument list for the tool chain

  • TC (or the default tool chain, if TC is not specified).
Parameters:
BoundArch- The bound architecture name, or 0.

Definition at line 58 of file Compilation.cpp.

References clang::driver::ToolChain::TranslateArgs().

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

const ToolChain& clang::driver::Compilation::getDefaultToolChain ( ) const [inline]
const Driver& clang::driver::Compilation::getDriver ( ) const [inline]
const ArgStringList& clang::driver::Compilation::getFailureResultFiles ( ) const [inline]

Definition at line 91 of file Compilation.h.

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

const InputArgList& clang::driver::Compilation::getInputArgs ( ) const [inline]

Definition at line 75 of file Compilation.h.

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

JobList& clang::driver::Compilation::getJobs ( ) [inline]
const JobList& clang::driver::Compilation::getJobs ( ) const [inline]

Definition at line 83 of file Compilation.h.

const ArgStringList& clang::driver::Compilation::getResultFiles ( ) const [inline]

Definition at line 89 of file Compilation.h.

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

StringRef Compilation::getSysRoot ( void  ) const

Returns the sysroot path.

Definition at line 234 of file Compilation.cpp.

References getDriver(), and clang::driver::Driver::SysRoot.

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

const ArgStringList& clang::driver::Compilation::getTempFiles ( ) const [inline]
void Compilation::initCompilationForDiagnostics ( void  )

initCompilationForDiagnostics - Remove stale state and suppress output so compilation can be reexecuted to generate additional diagnostic information (e.g., preprocessed source(s)).

Definition at line 209 of file Compilation.cpp.

References clang::driver::ArgList::ClaimAllArgs(), clang::driver::JobList::clear(), clang::driver::ArgList::eraseArg(), and clang::driver::ArgList::hasArg().

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

void Compilation::PrintJob ( raw_ostream &  OS,
const Job J,
const char *  Terminator,
bool  Quote 
) const

PrintJob - Print one job in -### format.

Parameters:
OS- The stream to print on.
J- The job to print.
Terminator- A string to print at the end of the line.
Quote- Should separate arguments be quoted.

Definition at line 73 of file Compilation.cpp.

References clang::driver::JobList::begin(), and clang::driver::JobList::end().

Referenced by ExecuteCommand(), clang::driver::Driver::ExecuteCompilation(), clang::driver::Driver::generateCompilationDiagnostics(), and clang::tooling::getCC1Arguments().


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