[lld] r276525 - Remove Phdr typedef.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 23 07:18:48 PDT 2016
Author: ruiu
Date: Sat Jul 23 09:18:48 2016
New Revision: 276525
URL: http://llvm.org/viewvc/llvm-project?rev=276525&view=rev
Log:
Remove Phdr typedef.
I don't think this typedef contributes to readability.
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=276525&r1=276524&r2=276525&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Sat Jul 23 09:18:48 2016
@@ -409,28 +409,28 @@ LinkerScript<ELFT>::createPhdrs(ArrayRef
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
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;
}
Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=276525&r1=276524&r2=276525&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Sat Jul 23 09:18:48 2016
@@ -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:
More information about the llvm-commits
mailing list