[lld] r204222 - [ELF] Remove unused fields (linking context references).

Simon Atanasyan simon at atanasyan.com
Wed Mar 19 04:05:55 PDT 2014


Author: atanasyan
Date: Wed Mar 19 06:05:55 2014
New Revision: 204222

URL: http://llvm.org/viewvc/llvm-project?rev=204222&view=rev
Log:
[ELF] Remove unused fields (linking context references).

Modified:
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFWriters.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
    lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
    lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFWriters.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFWriters.h?rev=204222&r1=204221&r2=204222&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFWriters.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonELFWriters.h Wed Mar 19 06:05:55 2014
@@ -52,7 +52,7 @@ protected:
   }
 
 private:
-  HexagonLinkingContext &_hexagonLinkingContext LLVM_ATTRIBUTE_UNUSED;
+  HexagonLinkingContext &_hexagonLinkingContext;
   HexagonTargetLayout<ELFT> &_hexagonTargetLayout;
 };
 

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h?rev=204222&r1=204221&r2=204222&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonRelocationHandler.h Wed Mar 19 06:05:55 2014
@@ -16,22 +16,19 @@
 namespace lld {
 namespace elf {
 
-class HexagonLinkingContext;
 class HexagonTargetHandler;
 
 class HexagonTargetRelocationHandler final :
     public TargetRelocationHandler<HexagonELFType> {
 public:
-  HexagonTargetRelocationHandler(HexagonLinkingContext &context,
-                                 HexagonTargetLayout<HexagonELFType> &layout)
-      : _hexagonLinkingContext(context), _hexagonTargetLayout(layout) {}
+  HexagonTargetRelocationHandler(HexagonTargetLayout<HexagonELFType> &layout)
+      : _hexagonTargetLayout(layout) {}
 
   virtual error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
                                      const lld::AtomLayout &,
                                      const Reference &) const;
 
 private:
-  HexagonLinkingContext &_hexagonLinkingContext LLVM_ATTRIBUTE_UNUSED;
   HexagonTargetLayout<HexagonELFType> &_hexagonTargetLayout;
 };
 } // elf

Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp?rev=204222&r1=204221&r2=204222&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonTargetHandler.cpp Wed Mar 19 06:05:55 2014
@@ -22,8 +22,8 @@ HexagonTargetHandler::HexagonTargetHandl
     : DefaultTargetHandler(context), _hexagonLinkingContext(context),
       _hexagonRuntimeFile(new HexagonRuntimeFile<HexagonELFType>(context)),
       _hexagonTargetLayout(new HexagonTargetLayout<HexagonELFType>(context)),
-      _hexagonRelocationHandler(new HexagonTargetRelocationHandler(
-          context, *_hexagonTargetLayout.get())) {}
+      _hexagonRelocationHandler(
+          new HexagonTargetRelocationHandler(*_hexagonTargetLayout.get())) {}
 
 std::unique_ptr<Writer> HexagonTargetHandler::getWriter() {
   switch (_hexagonLinkingContext.getOutputELFType()) {

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h?rev=204222&r1=204221&r2=204222&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64RelocationHandler.h Wed Mar 19 06:05:55 2014
@@ -15,16 +15,14 @@
 namespace lld {
 namespace elf {
 typedef llvm::object::ELFType<llvm::support::little, 2, true> X86_64ELFType;
-class X86_64LinkingContext;
 
 template <class ELFT> class X86_64TargetLayout;
 
 class X86_64TargetRelocationHandler final
     : public TargetRelocationHandler<X86_64ELFType> {
 public:
-  X86_64TargetRelocationHandler(const X86_64LinkingContext &context,
-                                X86_64TargetLayout<X86_64ELFType> &layout)
-      : _tlsSize(0), _context(context), _x86_64Layout(layout) {}
+  X86_64TargetRelocationHandler(X86_64TargetLayout<X86_64ELFType> &layout)
+      : _tlsSize(0), _x86_64Layout(layout) {}
 
   virtual error_code applyRelocation(ELFWriter &, llvm::FileOutputBuffer &,
                                      const lld::AtomLayout &,
@@ -37,7 +35,6 @@ public:
 private:
   // Cached size of the TLS segment.
   mutable uint64_t _tlsSize;
-  const X86_64LinkingContext &_context LLVM_ATTRIBUTE_UNUSED;
   X86_64TargetLayout<X86_64ELFType> &_x86_64Layout;
 };
 

Modified: lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp?rev=204222&r1=204221&r2=204222&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/X86_64/X86_64TargetHandler.cpp Wed Mar 19 06:05:55 2014
@@ -19,8 +19,8 @@ using namespace elf;
 X86_64TargetHandler::X86_64TargetHandler(X86_64LinkingContext &context)
     : DefaultTargetHandler(context), _context(context),
       _x86_64TargetLayout(new X86_64TargetLayout<X86_64ELFType>(context)),
-      _x86_64RelocationHandler(new X86_64TargetRelocationHandler(
-          context, *_x86_64TargetLayout.get())) {}
+      _x86_64RelocationHandler(
+          new X86_64TargetRelocationHandler(*_x86_64TargetLayout.get())) {}
 
 void X86_64TargetHandler::registerRelocationNames(Registry &registry) {
   registry.addKindTable(Reference::KindNamespace::ELF,





More information about the llvm-commits mailing list