clang API Documentation

Functions
Driver.cpp File Reference
#include "clang/Driver/Driver.h"
#include "InputInfo.h"
#include "ToolChains.h"
#include "clang/Basic/Version.h"
#include "clang/Config/config.h"
#include "clang/Driver/Action.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptSpecifier.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
#include <memory>
Include dependency graph for Driver.cpp:

Go to the source code of this file.

Functions

static Arg * MakeInputArg (DerivedArgList &Args, OptTable *Opts, StringRef Value)
static void PrintDiagnosticCategories (raw_ostream &OS)
static unsigned PrintActions1 (const Compilation &C, Action *A, std::map< Action *, unsigned > &Ids)
static bool ContainsCompileOrAssembleAction (const Action *A)
 Check whether the given input tree contains any compilation or assembly actions.
static bool DiagnoseInputExistence (const Driver &D, const DerivedArgList &Args, StringRef Value)
 Check that the file referenced by Value exists. If it doesn't, issue a diagnostic and return false.
static const ToolSelectToolForJob (Compilation &C, const ToolChain *TC, const JobAction *JA, const ActionList *&Inputs)
static const char * MakeCLOutputFilename (const ArgList &Args, StringRef ArgValue, StringRef BaseName, types::ID FileType)
 Create output filename based on ArgValue, which could either be a full filename, filename without extension, or a directory. If ArgValue does not provide a filename, then use BaseName, and use the extension suitable for FileType.
static bool ScanDirForExecutable (SmallString< 128 > &Dir, ArrayRef< std::string > Names)
static llvm::Triple computeTargetTriple (StringRef DefaultTargetTriple, const ArgList &Args, StringRef DarwinArchName)
 Compute target triple from args.

Function Documentation

static llvm::Triple computeTargetTriple ( StringRef  DefaultTargetTriple,
const ArgList &  Args,
StringRef  DarwinArchName 
) [static]

Compute target triple from args.

This routine provides the logic to compute a target triple from various args passed to the driver and the default triple string.

Definition at line 1901 of file Driver.cpp.

References clang::GNU, and clang::driver::tools::darwin::setTripleTypeForMachOArchName().

static bool ContainsCompileOrAssembleAction ( const Action A) [static]

Check whether the given input tree contains any compilation or assembly actions.

Definition at line 851 of file Driver.cpp.

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

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

static bool DiagnoseInputExistence ( const Driver D,
const DerivedArgList &  Args,
StringRef  Value 
) [static]

Check that the file referenced by Value exists. If it doesn't, issue a diagnostic and return false.

Definition at line 960 of file Driver.cpp.

References clang::driver::Driver::Diag(), clang::driver::Driver::getCheckInputsExist(), and clang::driver::Driver::IsCLMode().

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

static const char* MakeCLOutputFilename ( const ArgList &  Args,
StringRef  ArgValue,
StringRef  BaseName,
types::ID  FileType 
) [static]

Create output filename based on ArgValue, which could either be a full filename, filename without extension, or a directory. If ArgValue does not provide a filename, then use BaseName, and use the extension suitable for FileType.

Definition at line 1622 of file Driver.cpp.

References clang::driver::types::getTypeTempSuffix().

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

static Arg* MakeInputArg ( DerivedArgList &  Args,
OptTable *  Opts,
StringRef  Value 
) [static]

Definition at line 195 of file Driver.cpp.

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

static unsigned PrintActions1 ( const Compilation C,
Action A,
std::map< Action *, unsigned > &  Ids 
) [static]
static void PrintDiagnosticCategories ( raw_ostream &  OS) [static]

PrintDiagnosticCategories - Implement the --print-diagnostic-categories option.

Definition at line 676 of file Driver.cpp.

References clang::DiagnosticIDs::getCategoryNameFromID(), and clang::DiagnosticIDs::getNumberOfCategories().

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

static bool ScanDirForExecutable ( SmallString< 128 > &  Dir,
ArrayRef< std::string >  Names 
) [static]

Definition at line 1839 of file Driver.cpp.

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

static const Tool* SelectToolForJob ( Compilation C,
const ToolChain TC,
const JobAction JA,
const ActionList *&  Inputs 
) [static]