[lld] r297848 - [ELF] - Move LinkerScript::discard to LinkerScriptBase. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 08:42:44 PDT 2017


Author: grimar
Date: Wed Mar 15 10:42:44 2017
New Revision: 297848

URL: http://llvm.org/viewvc/llvm-project?rev=297848&view=rev
Log:
[ELF] - Move LinkerScript::discard to LinkerScriptBase. NFC.

Became possible after r297844


Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/LinkerScript.h

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=297848&r1=297847&r2=297848&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Wed Mar 15 10:42:44 2017
@@ -288,11 +288,10 @@ void LinkerScriptBase::computeInputSecti
   }
 }
 
-template <class ELFT>
-void LinkerScript<ELFT>::discard(ArrayRef<InputSectionBase *> V) {
+void LinkerScriptBase::discard(ArrayRef<InputSectionBase *> V) {
   for (InputSectionBase *S : V) {
     S->Live = false;
-    if (S == In<ELFT>::ShStrTab)
+    if (S == InX::ShStrTab)
       error("discarding .shstrtab section is not allowed");
     discard(S->DependentSections);
   }

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=297848&r1=297847&r2=297848&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Wed Mar 15 10:42:44 2017
@@ -267,6 +267,7 @@ public:
   uint64_t getDot() { return Dot; }
   OutputSection *getOutputSection(const Twine &Loc, StringRef S);
   uint64_t getOutputSectionSize(StringRef S);
+  void discard(ArrayRef<InputSectionBase *> V);
 
   virtual uint64_t getSymbolValue(const Twine &Loc, StringRef S) = 0;
   virtual bool isDefined(StringRef S) = 0;
@@ -300,7 +301,6 @@ public:
 
   void writeDataBytes(StringRef Name, uint8_t *Buf);
   void addSymbol(SymbolAssignment *Cmd);
-  void discard(ArrayRef<InputSectionBase *> V);
   void processCommands(OutputSectionFactory &Factory);
 
   uint64_t getSymbolValue(const Twine &Loc, StringRef S) override;




More information about the llvm-commits mailing list