<p dir="ltr">Nice! This code now always assigns the variables. Should we remove the initial assignment for config.h to make it clear that they are always initialized?</p>
<div class="gmail_quote">On Sep 29, 2015 6:34 PM, "Rui Ueyama via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Tue Sep 29 17:33:18 2015<br>
New Revision: 248837<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248837&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248837&view=rev</a><br>
Log:<br>
ELF2: Assign bool values directly. NFC.<br>
<br>
Modified:<br>
lld/trunk/ELF/Driver.cpp<br>
<br>
Modified: lld/trunk/ELF/Driver.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=248837&r1=248836&r2=248837&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=248837&r1=248836&r2=248837&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Driver.cpp (original)<br>
+++ lld/trunk/ELF/Driver.cpp Tue Sep 29 17:33:18 2015<br>
@@ -117,30 +117,17 @@ void LinkerDriver::link(ArrayRef<const c<br>
for (auto *Arg : Args.filtered(OPT_L))<br>
Config->InputSearchPaths.push_back(Arg->getValue());<br>
<br>
- if (Args.hasArg(OPT_shared))<br>
- Config->Shared = true;<br>
-<br>
- if (Args.hasArg(OPT_discard_all))<br>
- Config->DiscardAll = true;<br>
-<br>
- if (Args.hasArg(OPT_discard_locals))<br>
- Config->DiscardLocals = true;<br>
-<br>
- if (Args.hasArg(OPT_discard_none))<br>
- Config->DiscardNone = true;<br>
-<br>
- if (Args.hasArg(OPT_export_dynamic))<br>
- Config->ExportDynamic = true;<br>
-<br>
- if (Args.hasArg(OPT_noinhibit_exec))<br>
- Config->NoInhibitExec = true;<br>
-<br>
- if (Args.hasArg(OPT_allow_multiple_definition))<br>
- Config->AllowMultipleDefinition = true;<br>
-<br>
if (auto *Arg = Args.getLastArg(OPT_entry))<br>
Config->Entry = Arg->getValue();<br>
<br>
+ Config->AllowMultipleDefinition = Args.hasArg(OPT_allow_multiple_definition);<br>
+ Config->DiscardAll = Args.hasArg(OPT_discard_all);<br>
+ Config->DiscardLocals = Args.hasArg(OPT_discard_locals);<br>
+ Config->DiscardNone = Args.hasArg(OPT_discard_none);<br>
+ Config->ExportDynamic = Args.hasArg(OPT_export_dynamic);<br>
+ Config->NoInhibitExec = Args.hasArg(OPT_noinhibit_exec);<br>
+ Config->Shared = Args.hasArg(OPT_shared);<br>
+<br>
// Create a list of input files.<br>
std::vector<MemoryBufferRef> Inputs;<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>