[lld] 68009b7 - [ELF] Symbol::replace: remove dead code

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 16:08:22 PST 2021


Author: Fangrui Song
Date: 2021-12-15T16:08:18-08:00
New Revision: 68009b78f22cdacad66a49202e82c95fa5c5e8b1

URL: https://github.com/llvm/llvm-project/commit/68009b78f22cdacad66a49202e82c95fa5c5e8b1
DIFF: https://github.com/llvm/llvm-project/commit/68009b78f22cdacad66a49202e82c95fa5c5e8b1.diff

LOG: [ELF] Symbol::replace: remove dead code

Added: 
    

Modified: 
    lld/ELF/Symbols.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Symbols.h b/lld/ELF/Symbols.h
index 5171ca27d7d5..5569bd8880c2 100644
--- a/lld/ELF/Symbols.h
+++ b/lld/ELF/Symbols.h
@@ -566,11 +566,6 @@ void Symbol::replace(const Symbol &newSym) {
   scriptDefined = old.scriptDefined;
   partition = old.partition;
 
-  // Symbol length is computed lazily. If we already know a symbol length,
-  // propagate it.
-  if (nameData == old.nameData && nameSize == 0 && old.nameSize != 0)
-    nameSize = old.nameSize;
-
   // Print out a log message if --trace-symbol was specified.
   // This is for debugging.
   if (traced)


        


More information about the llvm-commits mailing list