[lld] r248837 - ELF2: Assign bool values directly. NFC.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 05:38:25 PDT 2015


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?
On Sep 29, 2015 6:34 PM, "Rui Ueyama via llvm-commits" <
llvm-commits at lists.llvm.org> wrote:

> Author: ruiu
> Date: Tue Sep 29 17:33:18 2015
> New Revision: 248837
>
> URL: http://llvm.org/viewvc/llvm-project?rev=248837&view=rev
> Log:
> ELF2: Assign bool values directly. NFC.
>
> Modified:
>     lld/trunk/ELF/Driver.cpp
>
> Modified: lld/trunk/ELF/Driver.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=248837&r1=248836&r2=248837&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Tue Sep 29 17:33:18 2015
> @@ -117,30 +117,17 @@ void LinkerDriver::link(ArrayRef<const c
>    for (auto *Arg : Args.filtered(OPT_L))
>      Config->InputSearchPaths.push_back(Arg->getValue());
>
> -  if (Args.hasArg(OPT_shared))
> -    Config->Shared = true;
> -
> -  if (Args.hasArg(OPT_discard_all))
> -    Config->DiscardAll = true;
> -
> -  if (Args.hasArg(OPT_discard_locals))
> -    Config->DiscardLocals = true;
> -
> -  if (Args.hasArg(OPT_discard_none))
> -    Config->DiscardNone = true;
> -
> -  if (Args.hasArg(OPT_export_dynamic))
> -    Config->ExportDynamic = true;
> -
> -  if (Args.hasArg(OPT_noinhibit_exec))
> -    Config->NoInhibitExec = true;
> -
> -  if (Args.hasArg(OPT_allow_multiple_definition))
> -    Config->AllowMultipleDefinition = true;
> -
>    if (auto *Arg = Args.getLastArg(OPT_entry))
>      Config->Entry = Arg->getValue();
>
> +  Config->AllowMultipleDefinition =
> Args.hasArg(OPT_allow_multiple_definition);
> +  Config->DiscardAll = Args.hasArg(OPT_discard_all);
> +  Config->DiscardLocals = Args.hasArg(OPT_discard_locals);
> +  Config->DiscardNone = Args.hasArg(OPT_discard_none);
> +  Config->ExportDynamic = Args.hasArg(OPT_export_dynamic);
> +  Config->NoInhibitExec = Args.hasArg(OPT_noinhibit_exec);
> +  Config->Shared = Args.hasArg(OPT_shared);
> +
>    // Create a list of input files.
>    std::vector<MemoryBufferRef> Inputs;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150930/0833305d/attachment.html>


More information about the llvm-commits mailing list