r187082 - Simplify code - no functionality change.
Eli Bendersky
eliben at google.com
Wed Jul 24 15:20:49 PDT 2013
Author: eliben
Date: Wed Jul 24 17:20:49 2013
New Revision: 187082
URL: http://llvm.org/viewvc/llvm-project?rev=187082&view=rev
Log:
Simplify code - no functionality change.
getToolChain().getTriple().getArch() can be replaced by getToolChain().getArch()
Modified:
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=187082&r1=187081&r2=187082&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jul 24 17:20:49 2013
@@ -882,7 +882,7 @@ static void getMipsCPUAndABI(const ArgLi
// 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,
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,
}
// 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,
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,
// 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,
// -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,
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,
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,
// 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 &
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(Comp
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() ||
More information about the cfe-commits
mailing list