clang API Documentation
#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>
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) |
enum Distro |
Distribution (very bare-bones at the moment).
Definition at line 2670 of file ToolChains.cpp.
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] |
Definition at line 2714 of file ToolChains.cpp.
References ArchLinux, DebianJessie, DebianLenny, DebianSqueeze, DebianWheezy, Exherbo, Fedora, OpenSUSE, RHEL4, RHEL5, RHEL6, UbuntuHardy, UbuntuIntrepid, UbuntuJaunty, UbuntuKarmic, UbuntuLucid, UbuntuMaverick, UbuntuNatty, UbuntuOneiric, UbuntuPrecise, UbuntuQuantal, UbuntuRaring, UbuntuSaucy, UbuntuTrusty, and UnknownDistro.
Referenced by clang::driver::toolchains::Linux::Linux().
static bool findBiarchMultilibs | ( | const llvm::Triple & | TargetTriple, |
StringRef | Path, | ||
const ArgList & | Args, | ||
bool | NeedsBiarchSuffix, | ||
DetectedMultilibs & | Result | ||
) | [static] |
Definition at line 1852 of file ToolChains.cpp.
References addMultilibFlag(), DetectedMultilibs::BiarchSibling, clang::driver::MultilibSet::FilterOut(), clang::driver::Multilib::flag(), clang::driver::Multilib::gccSuffix(), DetectedMultilibs::Multilibs, clang::driver::MultilibSet::push_back(), clang::driver::MultilibSet::select(), and DetectedMultilibs::SelectedMultilib.
static bool findMIPSMultilibs | ( | const llvm::Triple & | TargetTriple, |
StringRef | Path, | ||
const llvm::opt::ArgList & | Args, | ||
DetectedMultilibs & | Result | ||
) | [static] |
Definition at line 1565 of file ToolChains.cpp.
References addMultilibFlag(), DetectedMultilibs::BiarchSibling, clang::driver::MultilibSet::Either(), clang::driver::MultilibSet::FilterOut(), clang::driver::Multilib::flag(), clang::driver::Multilib::gccSuffix(), clang::driver::tools::mips::getMipsCPUAndABI(), clang::GNU, clang::driver::Multilib::includeSuffix(), isMicroMips(), isMips16(), isMips32(), isMips64(), isMipsEL(), clang::driver::tools::mips::isNaN2008(), isSoftFloatABI(), clang::driver::tools::mips::isUCLibc(), makeMultilib(), clang::driver::MultilibSet::Maybe(), DetectedMultilibs::Multilibs, clang::driver::MultilibSet::push_back(), clang::driver::MultilibSet::select(), DetectedMultilibs::SelectedMultilib, clang::driver::MultilibSet::setIncludeDirsCallback(), and clang::driver::MultilibSet::size().
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] |
Definition at line 1173 of file ToolChains.cpp.
References GCC_INSTALL_PREFIX.
Referenced by clang::driver::toolchains::Hexagon_TC::GetGnuDir(), and clang::driver::toolchains::Generic_GCC::GCCInstallationDetector::init().
static void GetHexagonLibraryPaths | ( | const ArgList & | Args, |
const std::string & | Ver, | ||
const std::string & | MarchString, | ||
const std::string & | InstalledDir, | ||
ToolChain::path_list * | LibPaths | ||
) | [static] |
Definition at line 2114 of file ToolChains.cpp.
References clang::driver::toolchains::Hexagon_TC::GetGnuDir().
Referenced by clang::driver::toolchains::Hexagon_TC::Hexagon_TC().
static int getHexagonVersion | ( | const ArgList & | Args | ) | [static] |
Definition at line 2263 of file ToolChains.cpp.
Referenced by clang::driver::toolchains::Hexagon_TC::GetTargetCPU().
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] |
Definition at line 2881 of file ToolChains.cpp.
References clang::driver::tools::mips::hasMipsAbiArg(), and isMipsArch().
Referenced by clang::driver::toolchains::Linux::Linux().
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().
Definition at line 1537 of file ToolChains.cpp.
Referenced by findMIPSMultilibs().
Definition at line 1525 of file ToolChains.cpp.
Referenced by findMIPSMultilibs().
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().
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().
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().
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().