@@ -3194,27 +3194,27 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
3194
3194
RenderExtraToolArgs (JA, CmdArgs);
3195
3195
3196
3196
// If using a driver driver, force the arch.
3197
- const std::string & Arch = getToolChain ().getArchName ();
3197
+ llvm::Triple::ArchType Arch = getToolChain ().getArch ();
3198
3198
if (getToolChain ().getTriple ().isOSDarwin ()) {
3199
3199
CmdArgs.push_back (" -arch" );
3200
3200
3201
3201
// FIXME: Remove these special cases.
3202
- if (Arch == " powerpc " )
3202
+ if (Arch == llvm::Triple::ppc )
3203
3203
CmdArgs.push_back (" ppc" );
3204
- else if (Arch == " powerpc64 " )
3204
+ else if (Arch == llvm::Triple::ppc64 )
3205
3205
CmdArgs.push_back (" ppc64" );
3206
3206
else
3207
- CmdArgs.push_back (Args.MakeArgString (Arch ));
3207
+ CmdArgs.push_back (Args.MakeArgString (getToolChain (). getArchName () ));
3208
3208
}
3209
3209
3210
3210
// Try to force gcc to match the tool chain we want, if we recognize
3211
3211
// the arch.
3212
3212
//
3213
3213
// FIXME: The triple class should directly provide the information we want
3214
3214
// here.
3215
- if (Arch == " i386 " || Arch == " powerpc " )
3215
+ if (Arch == llvm::Triple::x86 || Arch == llvm::Triple::ppc )
3216
3216
CmdArgs.push_back (" -m32" );
3217
- else if (Arch == " x86_64" || Arch == " powerpc64 " )
3217
+ else if (Arch == llvm::Triple:: x86_64 || Arch == llvm::Triple::x86_64 )
3218
3218
CmdArgs.push_back (" -m64" );
3219
3219
3220
3220
if (Output.isFilename ()) {
@@ -3874,7 +3874,7 @@ void darwin::CC1::AddCPPUniqueOptionsArgs(const ArgList &Args,
3874
3874
Args.AddLastArg (CmdArgs, options::OPT_P);
3875
3875
3876
3876
// FIXME: Handle %I properly.
3877
- if (getToolChain ().getArchName () == " x86_64" ) {
3877
+ if (getToolChain ().getArch () == llvm::Triple:: x86_64) {
3878
3878
CmdArgs.push_back (" -imultilib" );
3879
3879
CmdArgs.push_back (" x86_64" );
3880
3880
}
@@ -4552,7 +4552,7 @@ void darwin::Link::ConstructJob(Compilation &C, const JobAction &JA,
4552
4552
!Args.hasArg (options::OPT_nodefaultlibs)) {
4553
4553
// Avoid linking compatibility stubs on i386 mac.
4554
4554
if (!getDarwinToolChain ().isTargetMacOS () ||
4555
- getDarwinToolChain ().getArchName () != " i386 " ) {
4555
+ getDarwinToolChain ().getArch () != llvm::Triple::x86 ) {
4556
4556
// If we don't have ARC or subscripting runtime support, link in the
4557
4557
// runtime stubs. We have to do this *before* adding any of the normal
4558
4558
// linker inputs so that its initializer gets run first.
@@ -5301,12 +5301,12 @@ void freebsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
5301
5301
5302
5302
// When building 32-bit code on FreeBSD/amd64, we have to explicitly
5303
5303
// instruct ld in the base system to link 32-bit code.
5304
- if (ToolChain.getArchName () == " i386 " ) {
5304
+ if (ToolChain.getArch () == llvm::Triple::x86 ) {
5305
5305
CmdArgs.push_back (" -m" );
5306
5306
CmdArgs.push_back (" elf_i386_fbsd" );
5307
5307
}
5308
5308
5309
- if (ToolChain.getArchName () == " powerpc " ) {
5309
+ if (ToolChain.getArch () == llvm::Triple::ppc ) {
5310
5310
CmdArgs.push_back (" -m" );
5311
5311
CmdArgs.push_back (" elf32ppc_fbsd" );
5312
5312
}
@@ -5442,9 +5442,9 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
5442
5442
CmdArgs.push_back (" --32" );
5443
5443
5444
5444
// Set byte order explicitly
5445
- if (getToolChain ().getArchName () == " mips" )
5445
+ if (getToolChain ().getArch () == llvm::Triple:: mips)
5446
5446
CmdArgs.push_back (" -EB" );
5447
- else if (getToolChain ().getArchName () == " mipsel" )
5447
+ else if (getToolChain ().getArch () == llvm::Triple:: mipsel)
5448
5448
CmdArgs.push_back (" -EL" );
5449
5449
5450
5450
Args.AddAllArgValues (CmdArgs, options::OPT_Wa_COMMA,
@@ -6002,7 +6002,7 @@ void dragonfly::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
6002
6002
6003
6003
// When building 32-bit code on DragonFly/pc64, we have to explicitly
6004
6004
// instruct as in the base system to assemble 32-bit code.
6005
- if (getToolChain ().getArchName () == " i386 " )
6005
+ if (getToolChain ().getArch () == llvm::Triple::x86 )
6006
6006
CmdArgs.push_back (" --32" );
6007
6007
6008
6008
Args.AddAllArgValues (CmdArgs, options::OPT_Wa_COMMA,
@@ -6046,7 +6046,7 @@ void dragonfly::Link::ConstructJob(Compilation &C, const JobAction &JA,
6046
6046
6047
6047
// When building 32-bit code on DragonFly/pc64, we have to explicitly
6048
6048
// instruct ld in the base system to link 32-bit code.
6049
- if (getToolChain ().getArchName () == " i386 " ) {
6049
+ if (getToolChain ().getArch () == llvm::Triple::x86 ) {
6050
6050
CmdArgs.push_back (" -m" );
6051
6051
CmdArgs.push_back (" elf_i386" );
6052
6052
}
0 commit comments