clang 20.0.0git
Functions
Gnu.cpp File Reference
#include "Gnu.h"
#include "Arch/ARM.h"
#include "Arch/CSKY.h"
#include "Arch/LoongArch.h"
#include "Arch/Mips.h"
#include "Arch/PPC.h"
#include "Arch/RISCV.h"
#include "Arch/Sparc.h"
#include "Arch/SystemZ.h"
#include "CommonArgs.h"
#include "Linux.h"
#include "clang/Config/config.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/MultilibBuilder.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/Tool.h"
#include "clang/Driver/ToolChain.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Option/ArgList.h"
#include "llvm/Support/CodeGen.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/TargetParser/RISCVISAInfo.h"
#include "llvm/TargetParser/TargetParser.h"
#include <system_error>

Go to the source code of this file.

Functions

static bool forwardToGCC (const Option &O)
 
static void normalizeCPUNamesForAssembler (const ArgList &Args, ArgStringList &CmdArgs)
 
static const char * getLDMOption (const llvm::Triple &T, const ArgList &Args)
 
static bool getStaticPIE (const ArgList &Args, const ToolChain &TC)
 
static bool getStatic (const ArgList &Args)
 
static bool isSoftFloatABI (const ArgList &Args)
 
static bool isArmOrThumbArch (llvm::Triple::ArchType Arch)
 
static bool isMipsEL (llvm::Triple::ArchType Arch)
 
static bool isMips16 (const ArgList &Args)
 
static bool isMicroMips (const ArgList &Args)
 
static bool isMSP430 (llvm::Triple::ArchType Arch)
 
static bool findMipsCsMultilibs (const Multilib::flags_list &Flags, FilterNonExistent &NonExistent, DetectedMultilibs &Result)
 
static bool findMipsAndroidMultilibs (llvm::vfs::FileSystem &VFS, StringRef Path, const Multilib::flags_list &Flags, FilterNonExistent &NonExistent, DetectedMultilibs &Result)
 
static bool findMipsMuslMultilibs (const Multilib::flags_list &Flags, FilterNonExistent &NonExistent, DetectedMultilibs &Result)
 
static bool findMipsMtiMultilibs (const Multilib::flags_list &Flags, FilterNonExistent &NonExistent, DetectedMultilibs &Result)
 
static bool findMipsImgMultilibs (const Multilib::flags_list &Flags, FilterNonExistent &NonExistent, DetectedMultilibs &Result)
 
static void findAndroidArmMultilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
 
static bool findMSP430Multilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
 
static void findCSKYMultilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
 
static bool selectRISCVMultilib (const MultilibSet &RISCVMultilibSet, StringRef Arch, const Multilib::flags_list &Flags, llvm::SmallVectorImpl< Multilib > &SelectedMultilibs)
 Extend the multi-lib re-use selection mechanism for RISC-V.
 
static void findRISCVBareMetalMultilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
 
static void findRISCVMultilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, DetectedMultilibs &Result)
 
static bool findBiarchMultilibs (const Driver &D, const llvm::Triple &TargetTriple, StringRef Path, const ArgList &Args, bool NeedsBiarchSuffix, DetectedMultilibs &Result)
 
static llvm::StringRef getGCCToolchainDir (const ArgList &Args, llvm::StringRef SysRoot)
 

Function Documentation

◆ findAndroidArmMultilibs()

static void findAndroidArmMultilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
DetectedMultilibs Result 
)
static

◆ findBiarchMultilibs()

static bool findBiarchMultilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
bool  NeedsBiarchSuffix,
DetectedMultilibs Result 
)
static

◆ findCSKYMultilibs()

static void findCSKYMultilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
DetectedMultilibs Result 
)
static

◆ findMipsAndroidMultilibs()

static bool findMipsAndroidMultilibs ( llvm::vfs::FileSystem &  VFS,
StringRef  Path,
const Multilib::flags_list Flags,
FilterNonExistent &  NonExistent,
DetectedMultilibs Result 
)
static

◆ findMipsCsMultilibs()

static bool findMipsCsMultilibs ( const Multilib::flags_list Flags,
FilterNonExistent &  NonExistent,
DetectedMultilibs Result 
)
static

◆ findMipsImgMultilibs()

static bool findMipsImgMultilibs ( const Multilib::flags_list Flags,
FilterNonExistent &  NonExistent,
DetectedMultilibs Result 
)
static

◆ findMipsMtiMultilibs()

static bool findMipsMtiMultilibs ( const Multilib::flags_list Flags,
FilterNonExistent &  NonExistent,
DetectedMultilibs Result 
)
static

◆ findMipsMuslMultilibs()

static bool findMipsMuslMultilibs ( const Multilib::flags_list Flags,
FilterNonExistent &  NonExistent,
DetectedMultilibs Result 
)
static

◆ findMSP430Multilibs()

static bool findMSP430Multilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
DetectedMultilibs Result 
)
static

◆ findRISCVBareMetalMultilibs()

static void findRISCVBareMetalMultilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
DetectedMultilibs Result 
)
static

◆ findRISCVMultilibs()

static void findRISCVMultilibs ( const Driver D,
const llvm::Triple &  TargetTriple,
StringRef  Path,
const ArgList &  Args,
DetectedMultilibs Result 
)
static

◆ forwardToGCC()

static bool forwardToGCC ( const Option &  O)
static

◆ getGCCToolchainDir()

static llvm::StringRef getGCCToolchainDir ( const ArgList &  Args,
llvm::StringRef  SysRoot 
)
static

◆ getLDMOption()

static const char * getLDMOption ( const llvm::Triple &  T,
const ArgList &  Args 
)
static

◆ getStatic()

static bool getStatic ( const ArgList &  Args)
static

Definition at line 308 of file Gnu.cpp.

Referenced by clang::driver::tools::gnutools::Linker::ConstructJob().

◆ getStaticPIE()

static bool getStaticPIE ( const ArgList &  Args,
const ToolChain TC 
)
static

◆ isArmOrThumbArch()

static bool isArmOrThumbArch ( llvm::Triple::ArchType  Arch)
static

Definition at line 1022 of file Gnu.cpp.

◆ isMicroMips()

static bool isMicroMips ( const ArgList &  Args)
static

Definition at line 1035 of file Gnu.cpp.

◆ isMips16()

static bool isMips16 ( const ArgList &  Args)
static

Definition at line 1030 of file Gnu.cpp.

◆ isMipsEL()

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

Definition at line 1026 of file Gnu.cpp.

◆ isMSP430()

static bool isMSP430 ( llvm::Triple::ArchType  Arch)
static

Definition at line 1040 of file Gnu.cpp.

◆ isSoftFloatABI()

static bool isSoftFloatABI ( const ArgList &  Args)
static

Definition at line 1011 of file Gnu.cpp.

◆ normalizeCPUNamesForAssembler()

static void normalizeCPUNamesForAssembler ( const ArgList &  Args,
ArgStringList &  CmdArgs 
)
static

Definition at line 56 of file Gnu.cpp.

Referenced by clang::driver::tools::gnutools::Assembler::ConstructJob().

◆ selectRISCVMultilib()

static bool selectRISCVMultilib ( const MultilibSet RISCVMultilibSet,
StringRef  Arch,
const Multilib::flags_list Flags,
llvm::SmallVectorImpl< Multilib > &  SelectedMultilibs 
)
static

Extend the multi-lib re-use selection mechanism for RISC-V.

This function will try to re-use multi-lib if they are compatible. Definition of compatible:

  • ABI must be the same.
  • multi-lib is a subset of current arch, e.g. multi-lib=march=rv32im is a subset of march=rv32imc.
  • march that contains atomic extension can't reuse multi-lib that doesn't have atomic, vice versa. e.g. multi-lib=march=rv32im and march=rv32ima are not compatible, because software and hardware atomic operation can't work together correctly.

Definition at line 1740 of file Gnu.cpp.

References clang::driver::MultilibSetBuilder::Either(), clang::driver::MultilibBuilder::flag(), clang::driver::MultilibSetBuilder::makeMultilibSet(), and clang::driver::MultilibSet::select().

Referenced by findRISCVBareMetalMultilibs().