<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jun 29, 2018 at 6:59 PM George Rimar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: grimar<br>
Date: Fri Jun 29 02:54:51 2018<br>
New Revision: 335958<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=335958&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=335958&view=rev</a><br>
Log:<br>
[ELF] - Remove dead code.<br>
<br>
I do not think this code was ever alive,<br>
because the following code says we can have OutputSection and<br>
SymbolAssignment cases only. We already handle both of them.<br>
<br>
<a href="https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L502" rel="noreferrer" target="_blank">https://github.com/llvm-mirror/lld/blob/master/ELF/ScriptParser.cpp#L502</a><br>
<br>
FWIW, it is dead in the LLD code coverage reports I am running either.<br>
<br>
Modified:<br>
    lld/trunk/ELF/MapFile.cpp<br>
<br>
Modified: lld/trunk/ELF/MapFile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=335958&r1=335957&r2=335958&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/MapFile.cpp?rev=335958&r1=335957&r2=335958&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/MapFile.cpp (original)<br>
+++ lld/trunk/ELF/MapFile.cpp Fri Jun 29 02:54:51 2018<br>
@@ -174,9 +174,6 @@ void elf::writeMapFile() {<br>
     }<br>
<br>
     auto *OSec = dyn_cast<OutputSection>(Base);<br>
-    if (!OSec)<br>
-      continue;<br>
-<br></blockquote><div><br></div><div>If OSec cannot be null, we should use cast<> instead of dyn_cast<> to convey that meaning.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
     writeHeader(OS, OSec->Addr, OSec->getLMA(), OSec->Size, OSec->Alignment);<br>
     OS << OSec->Name << '\n';<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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></div>