clang API Documentation

Classes | Enumerations | Functions
ToolChains.cpp File Reference
#include "ToolChains.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Basic/Version.h"
#include "clang/Config/config.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/SanitizerArgs.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/Arg.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Option/OptTable.h"
#include "llvm/Option/Option.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include <cstdlib>
#include <system_error>
Include dependency graph for ToolChains.cpp:

Go to the source code of this file.

Classes

struct  DetectedMultilibs

Enumerations

enum  Distro {
  ArchLinux, DebianLenny, DebianSqueeze, DebianWheezy,
  DebianJessie, Exherbo, RHEL4, RHEL5,
  RHEL6, Fedora, OpenSUSE, UbuntuHardy,
  UbuntuIntrepid, UbuntuJaunty, UbuntuKarmic, UbuntuLucid,
  UbuntuMaverick, UbuntuNatty, UbuntuOneiric, UbuntuPrecise,
  UbuntuQuantal, UbuntuRaring, UbuntuSaucy, UbuntuTrusty,
  UnknownDistro
}
 Distribution (very bare-bones at the moment). More...

Functions

static const char * GetArmArchForMArch (StringRef Value)
static const char * GetArmArchForMCpu (StringRef Value)
static bool isSoftFloatABI (const ArgList &Args)
static bool isObjCAutoRefCount (const ArgList &Args)
 Determine whether Objective-C automated reference counting is enabled.
static llvm::StringRef getGCCToolchainDir (const ArgList &Args)
static void addMultilibFlag (bool Enabled, const char *const Flag, std::vector< std::string > &Flags)
static bool isMipsArch (llvm::Triple::ArchType Arch)
static bool isMips32 (llvm::Triple::ArchType Arch)
static bool isMips64 (llvm::Triple::ArchType Arch)
static bool isMipsEL (llvm::Triple::ArchType Arch)
static bool isMips16 (const ArgList &Args)
static bool isMicroMips (const ArgList &Args)
static Multilib makeMultilib (StringRef commonSuffix)
static bool findMIPSMultilibs (const llvm::Triple &TargetTriple, StringRef Path, const llvm::opt::ArgList &Args, DetectedMultilibs &Result)
static bool findBiarchMultilibs (const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, bool NeedsBiarchSuffix, DetectedMultilibs &Result)
static void GetHexagonLibraryPaths (const ArgList &Args, const std::string &Ver, const std::string &MarchString, const std::string &InstalledDir, ToolChain::path_list *LibPaths)
static int getHexagonVersion (const ArgList &Args)
static bool IsRedhat (enum Distro Distro)
static bool IsOpenSUSE (enum Distro Distro)
static bool IsDebian (enum Distro Distro)
static bool IsUbuntu (enum Distro Distro)
static Distro DetectDistro (llvm::Triple::ArchType Arch)
static std::string getMultiarchTriple (const llvm::Triple &TargetTriple, StringRef SysRoot)
 Get our best guess at the multiarch triple for a target.
static void addPathIfExists (Twine Path, ToolChain::path_list &Paths)
static StringRef getOSLibDir (const llvm::Triple &Triple, const ArgList &Args)

Enumeration Type Documentation

enum Distro

Distribution (very bare-bones at the moment).

Enumerator:
ArchLinux 
DebianLenny 
DebianSqueeze 
DebianWheezy 
DebianJessie 
Exherbo 
RHEL4 
RHEL5 
RHEL6 
Fedora 
OpenSUSE 
UbuntuHardy 
UbuntuIntrepid 
UbuntuJaunty 
UbuntuKarmic 
UbuntuLucid 
UbuntuMaverick 
UbuntuNatty 
UbuntuOneiric 
UbuntuPrecise 
UbuntuQuantal 
UbuntuRaring 
UbuntuSaucy 
UbuntuTrusty 
UnknownDistro 

Definition at line 2670 of file ToolChains.cpp.


Function Documentation

static void addMultilibFlag ( bool  Enabled,
const char *const  Flag,
std::vector< std::string > &  Flags 
) [static]

Definition at line 1512 of file ToolChains.cpp.

Referenced by findBiarchMultilibs(), and findMIPSMultilibs().

static void addPathIfExists ( Twine  Path,
ToolChain::path_list Paths 
) [static]

Definition at line 2877 of file ToolChains.cpp.

Referenced by clang::driver::toolchains::Linux::Linux().

static Distro DetectDistro ( llvm::Triple::ArchType  Arch) [static]
static bool findBiarchMultilibs ( const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
bool  NeedsBiarchSuffix,
DetectedMultilibs Result 
) [static]
static bool findMIPSMultilibs ( const llvm::Triple &  TargetTriple,
StringRef  Path,
const llvm::opt::ArgList &  Args,
DetectedMultilibs Result 
) [static]
static const char* GetArmArchForMArch ( StringRef  Value) [static]

Definition at line 111 of file ToolChains.cpp.

Referenced by clang::driver::toolchains::MachO::getMachOArchName().

static const char* GetArmArchForMCpu ( StringRef  Value) [static]

Definition at line 128 of file ToolChains.cpp.

Referenced by clang::driver::toolchains::MachO::getMachOArchName().

static llvm::StringRef getGCCToolchainDir ( const ArgList &  Args) [static]
static void GetHexagonLibraryPaths ( const ArgList &  Args,
const std::string &  Ver,
const std::string &  MarchString,
const std::string &  InstalledDir,
ToolChain::path_list LibPaths 
) [static]
static int getHexagonVersion ( const ArgList &  Args) [static]
static std::string getMultiarchTriple ( const llvm::Triple &  TargetTriple,
StringRef  SysRoot 
) [static]

Get our best guess at the multiarch triple for a target.

Debian-based systems are starting to use a multiarch setup where they use a target-triple directory in the library and header search paths. Unfortunately, this triple does not align with the vanilla target triple, so we provide a rough mapping here.

Definition at line 2791 of file ToolChains.cpp.

Referenced by clang::driver::toolchains::Linux::AddClangCXXStdlibIncludeArgs(), and clang::driver::toolchains::Linux::Linux().

static StringRef getOSLibDir ( const llvm::Triple &  Triple,
const ArgList &  Args 
) [static]
static bool IsDebian ( enum Distro  Distro) [static]

Definition at line 2706 of file ToolChains.cpp.

References DebianJessie, and DebianLenny.

Referenced by clang::driver::toolchains::Linux::Linux().

static bool isMicroMips ( const ArgList &  Args) [static]

Definition at line 1543 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool isMips16 ( const ArgList &  Args) [static]

Definition at line 1537 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool isMips32 ( llvm::Triple::ArchType  Arch) [static]

Definition at line 1525 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool isMips64 ( llvm::Triple::ArchType  Arch) [static]

Definition at line 1529 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool isMipsArch ( llvm::Triple::ArchType  Arch) [static]

Definition at line 1520 of file ToolChains.cpp.

Referenced by getOSLibDir(), and clang::driver::toolchains::Linux::Linux().

static bool isMipsEL ( llvm::Triple::ArchType  Arch) [static]

Definition at line 1533 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool isObjCAutoRefCount ( const ArgList &  Args) [static]

Determine whether Objective-C automated reference counting is enabled.

Definition at line 260 of file ToolChains.cpp.

Referenced by clang::driver::toolchains::DarwinClang::AddLinkARCArgs().

static bool IsOpenSUSE ( enum Distro  Distro) [static]

Definition at line 2702 of file ToolChains.cpp.

References OpenSUSE.

Referenced by clang::driver::toolchains::Linux::Linux().

static bool IsRedhat ( enum Distro  Distro) [static]

Definition at line 2698 of file ToolChains.cpp.

References Fedora, RHEL4, and RHEL6.

Referenced by clang::driver::toolchains::Linux::Linux().

static bool isSoftFloatABI ( const ArgList &  Args) [static]

Definition at line 145 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().

static bool IsUbuntu ( enum Distro  Distro) [static]

Definition at line 2710 of file ToolChains.cpp.

References UbuntuHardy, and UbuntuTrusty.

Referenced by clang::driver::toolchains::Linux::Linux().

static Multilib makeMultilib ( StringRef  commonSuffix) [static]

Definition at line 1561 of file ToolChains.cpp.

Referenced by findMIPSMultilibs().