[lld] r297286 - Convert a few more uses of uintX_t to uint64_t.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 07:34:04 PST 2017


Author: rafael
Date: Wed Mar  8 09:34:04 2017
New Revision: 297286

URL: http://llvm.org/viewvc/llvm-project?rev=297286&view=rev
Log:
Convert a few more uses of uintX_t to uint64_t.

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/Symbols.cpp
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=297286&r1=297285&r2=297286&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Wed Mar  8 09:34:04 2017
@@ -101,7 +101,6 @@ uint64_t InputSectionBase::getOffset() c
 
 template <class ELFT>
 uint64_t InputSectionBase::getOffset(uint64_t Offset) const {
-  typedef typename ELFT::uint uintX_t;
   switch (kind()) {
   case Regular:
     return cast<InputSection>(this)->OutSecOff + Offset;
@@ -109,7 +108,7 @@ uint64_t InputSectionBase::getOffset(uin
     // For synthetic sections we treat offset -1 as the end of the section.
     // The same approach is used for synthetic symbols (DefinedSynthetic).
     return cast<InputSection>(this)->OutSecOff +
-           (Offset == uintX_t(-1) ? getSize<ELFT>() : Offset);
+           (Offset == uint64_t(-1) ? getSize<ELFT>() : Offset);
   case EHFrame:
     // The file crtbeginT.o has relocations pointing to the start of an empty
     // .eh_frame that is known to be the first in the link. It does that to

Modified: lld/trunk/ELF/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=297286&r1=297285&r2=297286&view=diff
==============================================================================
--- lld/trunk/ELF/Symbols.cpp (original)
+++ lld/trunk/ELF/Symbols.cpp Wed Mar  8 09:34:04 2017
@@ -42,15 +42,13 @@ DefinedRegular *ElfSym::MipsGp;
 
 template <class ELFT>
 static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) {
-  typedef typename ELFT::uint uintX_t;
-
   switch (Body.kind()) {
   case SymbolBody::DefinedSyntheticKind: {
     auto &D = cast<DefinedSynthetic>(Body);
     const OutputSection *Sec = D.Section;
     if (!Sec)
       return D.Value;
-    if (D.Value == uintX_t(-1))
+    if (D.Value == uint64_t(-1))
       return Sec->Addr + Sec->Size;
     return Sec->Addr + D.Value;
   }
@@ -99,7 +97,7 @@ static typename ELFT::uint getSymVA(cons
     // If you understand the data structures involved with this next
     // line (and how they get built), then you have a pretty good
     // understanding of the linker.
-    uintX_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset<ELFT>(Offset);
+    uint64_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset<ELFT>(Offset);
 
     if (D.isTls() && !Config->Relocatable) {
       if (!Out::TlsPhdr)

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=297286&r1=297285&r2=297286&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Mar  8 09:34:04 2017
@@ -734,9 +734,9 @@ void PhdrEntry::add(OutputSection *Sec)
 }
 
 template <class ELFT>
-static DefinedSynthetic *
-addOptionalSynthetic(StringRef Name, OutputSection *Sec,
-                     typename ELFT::uint Val, uint8_t StOther = STV_HIDDEN) {
+static DefinedSynthetic *addOptionalSynthetic(StringRef Name,
+                                              OutputSection *Sec, uint64_t Val,
+                                              uint8_t StOther = STV_HIDDEN) {
   if (SymbolBody *S = Symtab<ELFT>::X->find(Name))
     if (!S->isInCurrentDSO())
       return cast<DefinedSynthetic>(
@@ -756,7 +756,7 @@ static Symbol *addRegular(StringRef Name
 
 template <class ELFT>
 static Symbol *addOptionalRegular(StringRef Name, InputSectionBase *IS,
-                                  typename ELFT::uint Value) {
+                                  uint64_t Value) {
   SymbolBody *S = Symtab<ELFT>::X->find(Name);
   if (!S)
     return nullptr;




More information about the llvm-commits mailing list