if (A->getOption().matches(options::OPT_Xarch__)) {
// Skip this argument unless the architecture matches either the toolchain
// triple arch, or the arch being bound.
- //
- // FIXME: Canonicalize name.
- StringRef XarchArch = A->getValue(Args, 0);
- if (!(XarchArch == getArchName() ||
- (BoundArch && XarchArch == BoundArch)))
+ llvm::Triple::ArchType XarchArch =
+ llvm::Triple::getArchTypeForDarwinArchName(A->getValue(Args, 0));
+ if (!(XarchArch == getArch() ||
+ (BoundArch && XarchArch ==
+ llvm::Triple::getArchTypeForDarwinArchName(BoundArch))))
continue;
Arg *OriginalArg = A;
}
const char *Darwin::GetForcedPicModel() const {
- if (getArchName() == "x86_64")
+ if (getArch() == llvm::Triple::x86_64)
return "pic";
return 0;
}
bool Darwin::SupportsProfiling() const {
// Profiling instrumentation is only supported on x86.
- return getArchName() == "i386" || getArchName() == "x86_64";
+ return getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::x86_64;
}
bool Darwin::SupportsObjCGC() const {
RenderExtraToolArgs(JA, CmdArgs);
// If using a driver driver, force the arch.
- const std::string &Arch = getToolChain().getArchName();
+ llvm::Triple::ArchType Arch = getToolChain().getArch();
if (getToolChain().getTriple().isOSDarwin()) {
CmdArgs.push_back("-arch");
// FIXME: Remove these special cases.
- if (Arch == "powerpc")
+ if (Arch == llvm::Triple::ppc)
CmdArgs.push_back("ppc");
- else if (Arch == "powerpc64")
+ else if (Arch == llvm::Triple::ppc64)
CmdArgs.push_back("ppc64");
else
- CmdArgs.push_back(Args.MakeArgString(Arch));
+ CmdArgs.push_back(Args.MakeArgString(getToolChain().getArchName()));
}
// Try to force gcc to match the tool chain we want, if we recognize
//
// FIXME: The triple class should directly provide the information we want
// here.
- if (Arch == "i386" || Arch == "powerpc")
+ if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc)
CmdArgs.push_back("-m32");
- else if (Arch == "x86_64" || Arch == "powerpc64")
+ else if (Arch == llvm::Triple::x86_64 || Arch == llvm::Triple::x86_64)
CmdArgs.push_back("-m64");
if (Output.isFilename()) {
Args.AddLastArg(CmdArgs, options::OPT_P);
// FIXME: Handle %I properly.
- if (getToolChain().getArchName() == "x86_64") {
+ if (getToolChain().getArch() == llvm::Triple::x86_64) {
CmdArgs.push_back("-imultilib");
CmdArgs.push_back("x86_64");
}
!Args.hasArg(options::OPT_nodefaultlibs)) {
// Avoid linking compatibility stubs on i386 mac.
if (!getDarwinToolChain().isTargetMacOS() ||
- getDarwinToolChain().getArchName() != "i386") {
+ getDarwinToolChain().getArch() != llvm::Triple::x86) {
// If we don't have ARC or subscripting runtime support, link in the
// runtime stubs. We have to do this *before* adding any of the normal
// linker inputs so that its initializer gets run first.
// When building 32-bit code on FreeBSD/amd64, we have to explicitly
// instruct ld in the base system to link 32-bit code.
- if (ToolChain.getArchName() == "i386") {
+ if (ToolChain.getArch() == llvm::Triple::x86) {
CmdArgs.push_back("-m");
CmdArgs.push_back("elf_i386_fbsd");
}
- if (ToolChain.getArchName() == "powerpc") {
+ if (ToolChain.getArch() == llvm::Triple::ppc) {
CmdArgs.push_back("-m");
CmdArgs.push_back("elf32ppc_fbsd");
}
CmdArgs.push_back("--32");
// Set byte order explicitly
- if (getToolChain().getArchName() == "mips")
+ if (getToolChain().getArch() == llvm::Triple::mips)
CmdArgs.push_back("-EB");
- else if (getToolChain().getArchName() == "mipsel")
+ else if (getToolChain().getArch() == llvm::Triple::mipsel)
CmdArgs.push_back("-EL");
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
// When building 32-bit code on DragonFly/pc64, we have to explicitly
// instruct as in the base system to assemble 32-bit code.
- if (getToolChain().getArchName() == "i386")
+ if (getToolChain().getArch() == llvm::Triple::x86)
CmdArgs.push_back("--32");
Args.AddAllArgValues(CmdArgs, options::OPT_Wa_COMMA,
// When building 32-bit code on DragonFly/pc64, we have to explicitly
// instruct ld in the base system to link 32-bit code.
- if (getToolChain().getArchName() == "i386") {
+ if (getToolChain().getArch() == llvm::Triple::x86) {
CmdArgs.push_back("-m");
CmdArgs.push_back("elf_i386");
}