r199529 - Use switch statements in preparation for adding more architectures.
Joerg Sonnenberger
joerg at bec.de
Fri Jan 17 16:50:50 PST 2014
Author: joerg
Date: Fri Jan 17 18:50:49 2014
New Revision: 199529
URL: http://llvm.org/viewvc/llvm-project?rev=199529&view=rev
Log:
Use switch statements in preparation for adding more architectures.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=199529&r1=199528&r2=199529&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jan 17 18:50:49 2014
@@ -2262,8 +2262,13 @@ NetBSD::GetCXXStdlibType(const ArgList &
unsigned Major, Minor, Micro;
getTriple().getOSVersion(Major, Minor, Micro);
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 23) || Major == 0) {
- if (getArch() == llvm::Triple::x86 || getArch() == llvm::Triple::x86_64)
+ switch (getArch()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
return ToolChain::CST_Libcxx;
+ default:
+ break;
+ }
}
return ToolChain::CST_Libstdcxx;
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=199529&r1=199528&r2=199529&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Jan 17 18:50:49 2014
@@ -6101,9 +6101,14 @@ void netbsd::Link::ConstructJob(Compilat
getToolChain().getTriple().getOSVersion(Major, Minor, Micro);
bool useLibgcc = true;
if (Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 23) || Major == 0) {
- if (getToolChain().getArch() == llvm::Triple::x86 ||
- getToolChain().getArch() == llvm::Triple::x86_64)
+ switch(getToolChain().getArch()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
useLibgcc = false;
+ break;
+ default:
+ break;
+ }
}
if (!Args.hasArg(options::OPT_nostdlib) &&
More information about the cfe-commits
mailing list