[lld] r335958 - [ELF] - Remove dead code.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 01:25:43 PDT 2018


On Fri, Jun 29, 2018 at 6:59 PM George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Fri Jun 29 02:54:51 2018
> New Revision: 335958
>
> URL: http://llvm.org/viewvc/llvm-project?rev=335958&view=rev
> Log:
> [ELF] - Remove dead code.
>
> I do not think this code was ever alive,
> because the following code says we can have OutputSection and
> SymbolAssignment cases only. We already handle both of them.
>
> https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L502
>
> FWIW, it is dead in the LLD code coverage reports I am running either.
>
> Modified:
>     lld/trunk/ELF/MapFile.cpp
>
> Modified: lld/trunk/ELF/MapFile.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=335958&r1=335957&r2=335958&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/MapFile.cpp (original)
> +++ lld/trunk/ELF/MapFile.cpp Fri Jun 29 02:54:51 2018
> @@ -174,9 +174,6 @@ void elf::writeMapFile() {
>      }
>
>      auto *OSec = dyn_cast<OutputSection>(Base);
> -    if (!OSec)
> -      continue;
> -
>

If OSec cannot be null, we should use cast<> instead of dyn_cast<> to
convey that meaning.


>      writeHeader(OS, OSec->Addr, OSec->getLMA(), OSec->Size,
> OSec->Alignment);
>      OS << OSec->Name << '\n';
>
>
>
> _______________________________________________
> 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/20180702/f2aba076/attachment.html>


More information about the llvm-commits mailing list