[lld] r256971 - Rename GroupEntryType -> uint32_X.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 12:30:03 PST 2016


Author: ruiu
Date: Wed Jan  6 14:30:02 2016
New Revision: 256971

URL: http://llvm.org/viewvc/llvm-project?rev=256971&view=rev
Log:
Rename GroupEntryType -> uint32_X.

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

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

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=256971&r1=256970&r2=256971&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Wed Jan  6 14:30:02 2016
@@ -132,13 +132,13 @@ StringRef ObjectFile<ELFT>::getShtGroupS
 }
 
 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>::initializeSection
       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;

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=256971&r1=256970&r2=256971&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Wed Jan  6 14:30:02 2016
@@ -91,10 +91,13 @@ template <class ELFT> class ObjectFile :
   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) {




More information about the llvm-commits mailing list