[lld] r296162 - Use uint64_t instead of uintX_t where the larger type just works.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 11:52:52 PST 2017


Author: ruiu
Date: Fri Feb 24 13:52:52 2017
New Revision: 296162

URL: http://llvm.org/viewvc/llvm-project?rev=296162&view=rev
Log:
Use uint64_t instead of uintX_t where the larger type just works.

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=296162&r1=296161&r2=296162&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Fri Feb 24 13:52:52 2017
@@ -94,7 +94,7 @@ template <class ELFT> void elf::ObjectFi
 // using DWARF debug info.
 template <class ELFT>
 std::string elf::ObjectFile<ELFT>::getLineInfo(InputSectionBase *S,
-                                               uintX_t Offset) {
+                                               uint64_t Offset) {
   if (!DwarfLine)
     initializeDwarfLine();
 
@@ -241,14 +241,14 @@ bool elf::ObjectFile<ELFT>::shouldMerge(
   // the section does not hold a table of fixed-size entries". We know
   // that Rust 1.13 produces a string mergeable section with a zero
   // sh_entsize. Here we just accept it rather than being picky about it.
-  uintX_t EntSize = Sec.sh_entsize;
+  uint64_t EntSize = Sec.sh_entsize;
   if (EntSize == 0)
     return false;
   if (Sec.sh_size % EntSize)
     fatal(toString(this) +
           ": SHF_MERGE section size must be a multiple of sh_entsize");
 
-  uintX_t Flags = Sec.sh_flags;
+  uint64_t Flags = Sec.sh_flags;
   if (!(Flags & SHF_MERGE))
     return false;
   if (Flags & SHF_WRITE)
@@ -499,8 +499,8 @@ SymbolBody *elf::ObjectFile<ELFT>::creat
 
   uint8_t StOther = Sym->st_other;
   uint8_t Type = Sym->getType();
-  uintX_t Value = Sym->st_value;
-  uintX_t Size = Sym->st_size;
+  uint64_t Value = Sym->st_value;
+  uint64_t Size = Sym->st_size;
 
   if (Binding == STB_LOCAL) {
     if (Sym->getType() == STT_FILE)
@@ -639,7 +639,7 @@ template <class ELFT> void SharedFile<EL
             toString(this) + ": getSectionContentsAsArray failed");
   for (const Elf_Dyn &Dyn : Arr) {
     if (Dyn.d_tag == DT_SONAME) {
-      uintX_t Val = Dyn.getVal();
+      uint64_t Val = Dyn.getVal();
       if (Val >= this->StringTable.size())
         fatal(toString(this) + ": invalid DT_SONAME entry");
       SoName = StringRef(this->StringTable.data() + Val);

Modified: lld/trunk/ELF/InputFiles.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=296162&r1=296161&r2=296162&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.h (original)
+++ lld/trunk/ELF/InputFiles.h Fri Feb 24 13:52:52 2017
@@ -138,7 +138,6 @@ template <class ELFT> class ObjectFile :
   typedef typename ELFT::Shdr Elf_Shdr;
   typedef typename ELFT::SymRange Elf_Sym_Range;
   typedef typename ELFT::Word Elf_Word;
-  typedef typename ELFT::uint uintX_t;
 
   StringRef getShtGroupSignature(ArrayRef<Elf_Shdr> Sections,
                                  const Elf_Shdr &Sec);
@@ -173,7 +172,7 @@ public:
 
   // Returns source line information for a given offset.
   // If no information is available, returns "".
-  std::string getLineInfo(InputSectionBase *S, uintX_t Offset);
+  std::string getLineInfo(InputSectionBase *S, uint64_t Offset);
 
   // MIPS GP0 value defined by this file. This value represents the gp value
   // used to create the relocatable object and required to support
@@ -277,7 +276,6 @@ template <class ELFT> class SharedFile :
   typedef typename ELFT::Verdef Elf_Verdef;
   typedef typename ELFT::Versym Elf_Versym;
   typedef typename ELFT::Word Elf_Word;
-  typedef typename ELFT::uint uintX_t;
 
   std::vector<StringRef> Undefs;
   StringRef SoName;




More information about the llvm-commits mailing list