[lld] r320892 - [COFF] Simplify hasArgs calls. NFC
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 15 15:51:14 PST 2017
Author: smeenai
Date: Fri Dec 15 15:51:14 2017
New Revision: 320892
URL: http://llvm.org/viewvc/llvm-project?rev=320892&view=rev
Log:
[COFF] Simplify hasArgs calls. NFC
We can just pass multiple options to hasArgs (which will check for any
of those options being present) instead of calling it multiple times.
Modified:
lld/trunk/COFF/Driver.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=320892&r1=320891&r2=320892&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Fri Dec 15 15:51:14 2017
@@ -805,12 +805,11 @@ void LinkerDriver::link(ArrayRef<const c
errorHandler().Verbose = Config->Verbose;
// Handle /force or /force:unresolved
- if (Args.hasArg(OPT_force) || Args.hasArg(OPT_force_unresolved))
+ if (Args.hasArg(OPT_force, OPT_force_unresolved))
Config->Force = true;
// Handle /debug
- if (Args.hasArg(OPT_debug) || Args.hasArg(OPT_debug_dwarf) ||
- Args.hasArg(OPT_debug_ghash)) {
+ if (Args.hasArg(OPT_debug, OPT_debug_dwarf, OPT_debug_ghash)) {
Config->Debug = true;
if (auto *Arg = Args.getLastArg(OPT_debugtype))
Config->DebugTypes = parseDebugType(Arg->getValue());
@@ -1152,7 +1151,7 @@ void LinkerDriver::link(ArrayRef<const c
}
// Disable PDB generation if the user requested it.
- if (Args.hasArg(OPT_nopdb) || Args.hasArg(OPT_debug_dwarf))
+ if (Args.hasArg(OPT_nopdb, OPT_debug_dwarf))
Config->PDBPath = "";
// Set default image base if /base is not given.
More information about the llvm-commits
mailing list