[lld] r267333 - [ELF] Simplify. Remove unneeded else. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 24 07:54:13 PDT 2016


I think it is actually needed because error() is not a noreturn function.
We don't want to call addFile with the empty string.

On Sun, Apr 24, 2016 at 12:19 AM, Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: davide
> Date: Sun Apr 24 02:19:32 2016
> New Revision: 267333
>
> URL: http://llvm.org/viewvc/llvm-project?rev=267333&view=rev
> Log:
> [ELF] Simplify. Remove unneeded else. 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=267333&r1=267332&r2=267333&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Sun Apr 24 02:19:32 2016
> @@ -151,8 +151,7 @@ void LinkerDriver::addLibrary(StringRef
>    std::string Path = searchLibrary(Name);
>    if (Path.empty())
>      error("unable to find library -l" + Name);
> -  else
> -    addFile(Path);
> +  addFile(Path);
>  }
>
>  // This function is called on startup. We need this for LTO since
>
>
> _______________________________________________
> 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/20160424/be75991e/attachment.html>


More information about the llvm-commits mailing list