[lld] r337287 - [ELF] - Eliminate dead 'return' in EhFrameSection::finalizeContents(). NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 07:36:19 PDT 2018


Author: grimar
Date: Tue Jul 17 07:36:19 2018
New Revision: 337287

URL: http://llvm.org/viewvc/llvm-project?rev=337287&view=rev
Log:
[ELF] - Eliminate dead 'return' in EhFrameSection::finalizeContents(). NFC.

EhFrameSection::finalizeContents() is called from a single place:
https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1559

So code was dead.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=337287&r1=337286&r2=337287&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Tue Jul 17 07:36:19 2018
@@ -474,9 +474,7 @@ static void writeCieFde(uint8_t *Buf, Ar
 }
 
 void EhFrameSection::finalizeContents() {
-  if (this->Size)
-    return; // Already finalized.
-
+  assert(!this->Size); // Not finalized.
   size_t Off = 0;
   for (CieRecord *Rec : CieRecords) {
     Rec->Cie->OutputOff = Off;




More information about the llvm-commits mailing list