Rename GroupEntryType -> uint32_X.

GroupEntryType was a 32-bit integral type but that was not obvious
from its name.

llvm-svn: 256971
This commit is contained in:
Rui Ueyama 2016-01-06 20:30:02 +00:00
parent 83cd6e00e9
commit 33b3f21168
2 changed files with 10 additions and 8 deletions

View File

@ -132,13 +132,13 @@ StringRef ObjectFile<ELFT>::getShtGroupSignature(const Elf_Shdr &Sec) {
}
template <class ELFT>
ArrayRef<typename ObjectFile<ELFT>::GroupEntryType>
ArrayRef<typename ObjectFile<ELFT>::uint32_X>
ObjectFile<ELFT>::getShtGroupEntries(const Elf_Shdr &Sec) {
const ELFFile<ELFT> &Obj = this->ELFObj;
ErrorOr<ArrayRef<GroupEntryType>> EntriesOrErr =
Obj.template getSectionContentsAsArray<GroupEntryType>(&Sec);
ErrorOr<ArrayRef<uint32_X>> EntriesOrErr =
Obj.template getSectionContentsAsArray<uint32_X>(&Sec);
error(EntriesOrErr);
ArrayRef<GroupEntryType> Entries = *EntriesOrErr;
ArrayRef<uint32_X> Entries = *EntriesOrErr;
if (Entries.empty() || Entries[0] != GRP_COMDAT)
error("Unsupported SHT_GROUP format");
return Entries.slice(1);
@ -187,8 +187,7 @@ void ObjectFile<ELFT>::initializeSections(DenseSet<StringRef> &ComdatGroups) {
Sections[I] = &InputSection<ELFT>::Discarded;
if (ComdatGroups.insert(getShtGroupSignature(Sec)).second)
continue;
for (GroupEntryType E : getShtGroupEntries(Sec)) {
uint32_t SecIndex = E;
for (uint32_t SecIndex : getShtGroupEntries(Sec)) {
if (SecIndex >= Size)
error("Invalid section index in group");
Sections[SecIndex] = &InputSection<ELFT>::Discarded;

View File

@ -91,10 +91,13 @@ template <class ELFT> class ObjectFile : public ELFFileBase<ELFT> {
typedef typename llvm::object::ELFFile<ELFT>::Elf_Word Elf_Word;
typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
// uint32 in ELFT's byte order
typedef llvm::support::detail::packed_endian_specific_integral<
uint32_t, ELFT::TargetEndianness, 2> GroupEntryType;
uint32_t, ELFT::TargetEndianness, 2>
uint32_X;
StringRef getShtGroupSignature(const Elf_Shdr &Sec);
ArrayRef<GroupEntryType> getShtGroupEntries(const Elf_Shdr &Sec);
ArrayRef<uint32_X> getShtGroupEntries(const Elf_Shdr &Sec);
public:
static bool classof(const InputFile *F) {