[lld] r227501 - ELF: Remove dead code.

Rui Ueyama ruiu at google.com
Thu Jan 29 14:18:28 PST 2015


Author: ruiu
Date: Thu Jan 29 16:18:28 2015
New Revision: 227501

URL: http://llvm.org/viewvc/llvm-project?rev=227501&view=rev
Log:
ELF: Remove dead code.

_runLayoutPass is always true. No way to set a new value to the
member variable.

Modified:
    lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
    lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp

Modified: lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h?rev=227501&r1=227500&r2=227501&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h Thu Jan 29 16:18:28 2015
@@ -307,7 +307,6 @@ protected:
   bool _noInhibitExec;
   bool _exportDynamic;
   bool _mergeCommonStrings;
-  bool _runLayoutPass;
   bool _useShlibUndefines;
   bool _dynamicLinkerArg;
   bool _noAllowDynamicLibraries;

Modified: lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp?rev=227501&r1=227500&r2=227501&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFLinkingContext.cpp Thu Jan 29 16:18:28 2015
@@ -59,15 +59,14 @@ ELFLinkingContext::ELFLinkingContext(
     : _outputELFType(llvm::ELF::ET_EXEC), _triple(triple),
       _targetHandler(std::move(targetHandler)), _baseAddress(0),
       _isStaticExecutable(false), _noInhibitExec(false), _exportDynamic(false),
-      _mergeCommonStrings(false), _runLayoutPass(true),
-      _useShlibUndefines(true), _dynamicLinkerArg(false),
-      _noAllowDynamicLibraries(false), _mergeRODataToTextSegment(true),
-      _demangle(true), _alignSegments(true), _outputMagic(OutputMagic::DEFAULT),
-      _initFunction("_init"), _finiFunction("_fini"), _sysrootPath("") {}
+      _mergeCommonStrings(false), _useShlibUndefines(true),
+      _dynamicLinkerArg(false), _noAllowDynamicLibraries(false),
+      _mergeRODataToTextSegment(true), _demangle(true), _alignSegments(true),
+      _outputMagic(OutputMagic::DEFAULT), _initFunction("_init"),
+      _finiFunction("_fini"), _sysrootPath("") {}
 
 void ELFLinkingContext::addPasses(PassManager &pm) {
-  if (_runLayoutPass)
-    pm.add(std::unique_ptr<Pass>(new LayoutPass(registry())));
+  pm.add(std::unique_ptr<Pass>(new LayoutPass(registry())));
   pm.add(std::unique_ptr<Pass>(new elf::ArrayOrderPass()));
 }
 





More information about the llvm-commits mailing list