Remove redundant argument.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 3 Aug 2016 13:21:16 +0000 (13:21 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 3 Aug 2016 13:21:16 +0000 (13:21 +0000)
llvm-svn: 277594

lld/ELF/LinkerScript.cpp
lld/ELF/LinkerScript.h
lld/ELF/Writer.cpp

index 656e646..d0dee08 100644 (file)
@@ -218,9 +218,8 @@ template <class ELFT> void LinkerScript<ELFT>::filter() {
   }
 }
 
-template <class ELFT>
-void LinkerScript<ELFT>::assignAddresses(
-    ArrayRef<OutputSectionBase<ELFT> *> Sections) {
+template <class ELFT> void LinkerScript<ELFT>::assignAddresses() {
+  ArrayRef<OutputSectionBase<ELFT> *> Sections = *OutputSections;
   // Orphan sections are sections present in the input files which
   // are not explicitly placed into the output file by the linker script.
   // We place orphan sections at end of file.
@@ -289,8 +288,8 @@ void LinkerScript<ELFT>::assignAddresses(
 }
 
 template <class ELFT>
-std::vector<PhdrEntry<ELFT>>
-LinkerScript<ELFT>::createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> Sections) {
+std::vector<PhdrEntry<ELFT>> LinkerScript<ELFT>::createPhdrs() {
+  ArrayRef<OutputSectionBase<ELFT> *> Sections = *OutputSections;
   std::vector<PhdrEntry<ELFT>> Ret;
 
   for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
index e853d0c..2319cae 100644 (file)
@@ -133,12 +133,11 @@ public:
   void createSections(std::vector<OutputSectionBase<ELFT> *> *Out,
                       OutputSectionFactory<ELFT> &Factory);
 
-  std::vector<PhdrEntry<ELFT>>
-  createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> S);
+  std::vector<PhdrEntry<ELFT>> createPhdrs();
 
   ArrayRef<uint8_t> getFiller(StringRef Name);
   bool shouldKeep(InputSectionBase<ELFT> *S);
-  void assignAddresses(ArrayRef<OutputSectionBase<ELFT> *> S);
+  void assignAddresses();
   int compareSections(StringRef A, StringRef B);
   void addScriptedSymbols();
   bool hasPhdrsCommands();
index 7dafdb7..1211f4f 100644 (file)
@@ -245,12 +245,11 @@ template <class ELFT> void Writer<ELFT>::run() {
   if (Config->Relocatable) {
     assignFileOffsets();
   } else {
-    Phdrs = Script<ELFT>::X->hasPhdrsCommands()
-                ? Script<ELFT>::X->createPhdrs(OutputSections)
-                : createPhdrs();
+    Phdrs = Script<ELFT>::X->hasPhdrsCommands() ? Script<ELFT>::X->createPhdrs()
+                                                : createPhdrs();
     fixHeaders();
     if (ScriptConfig->HasContents) {
-      Script<ELFT>::X->assignAddresses(OutputSections);
+      Script<ELFT>::X->assignAddresses();
     } else {
       fixSectionAlignments();
       assignAddresses();