[lld] r204987 - Replace nested switches with if.
Rui Ueyama
ruiu at google.com
Thu Mar 27 20:29:01 PDT 2014
Author: ruiu
Date: Thu Mar 27 22:29:01 2014
New Revision: 204987
URL: http://llvm.org/viewvc/llvm-project?rev=204987&view=rev
Log:
Replace nested switches with if.
Modified:
lld/trunk/lib/Driver/GnuLdDriver.cpp
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=204987&r1=204986&r2=204987&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Thu Mar 27 22:29:01 2014
@@ -159,21 +159,11 @@ bool GnuLdDriver::applyEmulation(llvm::T
void GnuLdDriver::addPlatformSearchDirs(ELFLinkingContext &ctx,
llvm::Triple &triple,
llvm::Triple &baseTriple) {
- switch (triple.getOS()) {
- case llvm::Triple::NetBSD:
- switch (triple.getArch()) {
- case llvm::Triple::x86:
- if (baseTriple.getArch() == llvm::Triple::x86_64) {
- ctx.addSearchPath("=/usr/lib/i386");
- return;
- }
- break;
- default:
- break;
- }
- break;
- default:
- break;
+ if (triple.getOS() == llvm::Triple::NetBSD &&
+ triple.getArch() == llvm::Triple::x86 &&
+ baseTriple.getArch() == llvm::Triple::x86_64) {
+ ctx.addSearchPath("=/usr/lib/i386");
+ return;
}
ctx.addSearchPath("=/usr/lib");
}
More information about the llvm-commits
mailing list