Simplify code - no functionality change.

getToolChain().getTriple().getArch() can be replaced by getToolChain().getArch()

llvm-svn: 187082
This commit is contained in:
Eli Bendersky 2013-07-24 22:20:49 +00:00
parent a2cb9c42d3
commit d4a6aec963
1 changed files with 15 additions and 15 deletions

View File

@ -882,7 +882,7 @@ static void getMipsCPUAndABI(const ArgList &Args,
// Setup default CPU and ABI names.
if (CPUName.empty() && ABIName.empty()) {
switch (TC.getTriple().getArch()) {
switch (TC.getArch()) {
default:
llvm_unreachable("Unexpected triple arch name");
case llvm::Triple::mips:
@ -2210,7 +2210,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (Arg *A = Args.getLastArg(options::OPT_fpcc_struct_return,
options::OPT_freg_struct_return)) {
if (getToolChain().getTriple().getArch() != llvm::Triple::x86) {
if (getToolChain().getArch() != llvm::Triple::x86) {
D.Diag(diag::err_drv_unsupported_opt_for_target)
<< A->getSpelling() << getToolChain().getTriple().str();
} else if (A->getOption().matches(options::OPT_fpcc_struct_return)) {
@ -2446,7 +2446,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
// Add target specific cpu and features flags.
switch(getToolChain().getTriple().getArch()) {
switch(getToolChain().getArch()) {
default:
break;
@ -2507,7 +2507,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Arg *Unsupported;
if (types::isCXX(InputType) &&
getToolChain().getTriple().isOSDarwin() &&
getToolChain().getTriple().getArch() == llvm::Triple::x86) {
getToolChain().getArch() == llvm::Triple::x86) {
if ((Unsupported = Args.getLastArg(options::OPT_fapple_kext)) ||
(Unsupported = Args.getLastArg(options::OPT_mkernel)))
D.Diag(diag::err_drv_clang_unsupported_opt_cxx_darwin_i386)
@ -2906,8 +2906,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Report an error for -faltivec on anything other than PowerPC.
if (const Arg *A = Args.getLastArg(options::OPT_faltivec))
if (!(getToolChain().getTriple().getArch() == llvm::Triple::ppc ||
getToolChain().getTriple().getArch() == llvm::Triple::ppc64))
if (!(getToolChain().getArch() == llvm::Triple::ppc ||
getToolChain().getArch() == llvm::Triple::ppc64))
D.Diag(diag::err_drv_argument_only_allowed_with)
<< A->getAsString(Args) << "ppc/ppc64";
@ -3109,7 +3109,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// -fshort-enums=0 is default for all architectures except Hexagon.
if (Args.hasFlag(options::OPT_fshort_enums,
options::OPT_fno_short_enums,
getToolChain().getTriple().getArch() ==
getToolChain().getArch() ==
llvm::Triple::hexagon))
CmdArgs.push_back("-fshort-enums");
@ -3128,7 +3128,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_fno_use_cxa_atexit,
getToolChain().getTriple().getOS() != llvm::Triple::Cygwin &&
getToolChain().getTriple().getOS() != llvm::Triple::MinGW32 &&
getToolChain().getTriple().getArch() != llvm::Triple::hexagon) ||
getToolChain().getArch() != llvm::Triple::hexagon) ||
KernelOrKext)
CmdArgs.push_back("-fno-use-cxa-atexit");
@ -3195,7 +3195,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (!Args.hasFlag(options::OPT_fobjc_legacy_dispatch,
options::OPT_fno_objc_legacy_dispatch,
objcRuntime.isLegacyDispatchDefaultForArch(
getToolChain().getTriple().getArch()))) {
getToolChain().getArch()))) {
if (getToolChain().UseObjCMixedDispatch())
CmdArgs.push_back("-fobjc-dispatch-method=mixed");
else
@ -3488,8 +3488,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// FIXME: This is disabled until clang -cc1 supports -fno-builtin-foo. PR4941.
#if 0
if (getToolChain().getTriple().isOSDarwin() &&
(getToolChain().getTriple().getArch() == llvm::Triple::arm ||
getToolChain().getTriple().getArch() == llvm::Triple::thumb)) {
(getToolChain().getArch() == llvm::Triple::arm ||
getToolChain().getArch() == llvm::Triple::thumb)) {
if (!Args.hasArg(options::OPT_fbuiltin_strcat))
CmdArgs.push_back("-fno-builtin-strcat");
if (!Args.hasArg(options::OPT_fbuiltin_strcpy))
@ -3820,7 +3820,7 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-relax-all");
// Add target specific cpu and features flags.
switch(getToolChain().getTriple().getArch()) {
switch(getToolChain().getArch()) {
default:
break;
@ -4408,12 +4408,12 @@ void darwin::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
AddDarwinArch(Args, CmdArgs);
// Use -force_cpusubtype_ALL on x86 by default.
if (getToolChain().getTriple().getArch() == llvm::Triple::x86 ||
getToolChain().getTriple().getArch() == llvm::Triple::x86_64 ||
if (getToolChain().getArch() == llvm::Triple::x86 ||
getToolChain().getArch() == llvm::Triple::x86_64 ||
Args.hasArg(options::OPT_force__cpusubtype__ALL))
CmdArgs.push_back("-force_cpusubtype_ALL");
if (getToolChain().getTriple().getArch() != llvm::Triple::x86_64 &&
if (getToolChain().getArch() != llvm::Triple::x86_64 &&
(((Args.hasArg(options::OPT_mkernel) ||
Args.hasArg(options::OPT_fapple_kext)) &&
(!getDarwinToolChain().isTargetIPhoneOS() ||