summaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2014-02-02 22:50:34 +0000
committerJoerg Sonnenberger <joerg@bec.de>2014-02-02 22:50:34 +0000
commita5b33da343b259227fd94ceafab2164e92bb57d6 (patch)
tree22bf0460cd375ac732711033b385793984e58d3b /lib/Driver/Tools.cpp
parent2b063246acbbd646b9a15c9ed852db6f1573a370 (diff)
downloadclang-a5b33da343b259227fd94ceafab2164e92bb57d6.tar.gz
clang-a5b33da343b259227fd94ceafab2164e92bb57d6.tar.bz2
clang-a5b33da343b259227fd94ceafab2164e92bb57d6.tar.xz
Use a switch for the emulation handling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index cc0f7795ad..4bfc272f74 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -6110,16 +6110,15 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
}
}
- // When building 32-bit code on NetBSD/amd64, we have to explicitly
- // instruct ld in the base system to link 32-bit code.
- if (getToolChain().getArch() == llvm::Triple::x86) {
+ // Many NetBSD architectures support more than one ABI.
+ // Determine the correct emulation for ld.
+ switch (getToolChain().getArch()) {
+ case llvm::Triple::x86:
CmdArgs.push_back("-m");
CmdArgs.push_back("elf_i386");
- }
-
- // On ARM, the linker can generate either EABI or the older APCS.
- // Instruct it to use the correct emulation.
- if (getToolChain().getArch() == llvm::Triple::arm) {
+ break;
+ case llvm::Triple::arm:
+ case llvm::Triple::thumb:
CmdArgs.push_back("-m");
switch (getToolChain().getTriple().getEnvironment()) {
case llvm::Triple::EABI:
@@ -6132,6 +6131,9 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA,
CmdArgs.push_back("armelf_nbsd");
break;
}
+ break;
+ default:
+ break;
}
if (Output.isFilename()) {