From d769a1ed62cc501becfc5bffde6978c26ea490de Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sat, 18 Jan 2014 00:50:49 +0000 Subject: [PATCH] Use switch statements in preparation for adding more architectures. llvm-svn: 199529 --- clang/lib/Driver/ToolChains.cpp | 7 ++++++- clang/lib/Driver/Tools.cpp | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 1d32c4586e47..c0563469c1c1 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -2262,8 +2262,13 @@ NetBSD::GetCXXStdlibType(const ArgList &Args) const { 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; } diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 1f499cbb152c..cb65fc88063c 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6101,9 +6101,14 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, 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) &&