Remove Phdr typedef.
authorRui Ueyama <ruiu@google.com>
Sat, 23 Jul 2016 14:18:48 +0000 (14:18 +0000)
committerRui Ueyama <ruiu@google.com>
Sat, 23 Jul 2016 14:18:48 +0000 (14:18 +0000)
I don't think this typedef contributes to readability.

llvm-svn: 276525

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

index e140199..64a6849 100644 (file)
@@ -409,28 +409,28 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> Sections) {
   int TlsNum = -1;
   int NoteNum = -1;
   int RelroNum = -1;
-  Phdr *Load = nullptr;
+  PhdrEntry<ELFT> *Load = nullptr;
   uintX_t Flags = PF_R;
-  std::vector<Phdr> Phdrs;
+  std::vector<PhdrEntry<ELFT>> Phdrs;
 
   for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
     Phdrs.emplace_back(Cmd.Type, Cmd.Flags == UINT_MAX ? PF_R : Cmd.Flags);
-    Phdr &Added = Phdrs.back();
+    PhdrEntry<ELFT> &Phdr = Phdrs.back();
 
     if (Cmd.HasFilehdr)
-      Added.add(Out<ELFT>::ElfHeader);
+      Phdr.add(Out<ELFT>::ElfHeader);
     if (Cmd.HasPhdrs)
-      Added.add(Out<ELFT>::ProgramHeaders);
+      Phdr.add(Out<ELFT>::ProgramHeaders);
 
     switch (Cmd.Type) {
     case PT_INTERP:
       if (Out<ELFT>::Interp)
-        Added.add(Out<ELFT>::Interp);
+        Phdr.add(Out<ELFT>::Interp);
       break;
     case PT_DYNAMIC:
       if (isOutputDynamic<ELFT>()) {
-        Added.H.p_flags = toPhdrFlags(Out<ELFT>::Dynamic->getFlags());
-        Added.add(Out<ELFT>::Dynamic);
+        Phdr.H.p_flags = toPhdrFlags(Out<ELFT>::Dynamic->getFlags());
+        Phdr.add(Out<ELFT>::Dynamic);
       }
       break;
     case PT_TLS:
@@ -444,8 +444,8 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> Sections) {
       break;
     case PT_GNU_EH_FRAME:
       if (!Out<ELFT>::EhFrame->empty() && Out<ELFT>::EhFrameHdr) {
-        Added.H.p_flags = toPhdrFlags(Out<ELFT>::EhFrameHdr->getFlags());
-        Added.add(Out<ELFT>::EhFrameHdr);
+        Phdr.H.p_flags = toPhdrFlags(Out<ELFT>::EhFrameHdr->getFlags());
+        Phdr.add(Out<ELFT>::EhFrameHdr);
       }
       break;
     }
index 3bab5bd..7e9f157 100644 (file)
@@ -113,17 +113,17 @@ template <class ELFT> class LinkerScript {
   typedef typename ELFT::uint uintX_t;
 
 public:
-  typedef PhdrEntry<ELFT> Phdr;
-
   std::vector<OutputSectionBase<ELFT> *>
   createSections(OutputSectionFactory<ELFT> &Factory);
 
+  std::vector<PhdrEntry<ELFT>>
+  createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> S);
+
   ArrayRef<uint8_t> getFiller(StringRef Name);
   bool shouldKeep(InputSectionBase<ELFT> *S);
   void assignAddresses(ArrayRef<OutputSectionBase<ELFT> *> S);
   int compareSections(StringRef A, StringRef B);
   void addScriptedSymbols();
-  std::vector<Phdr> createPhdrs(ArrayRef<OutputSectionBase<ELFT> *> S);
   bool hasPhdrsCommands();
 
 private: