Use uint64_t instead of uintX_t and size_t.

uint64_t is simpler and less error-prone than target or host-dependent types.

llvm-svn: 298969
This commit is contained in:
Rui Ueyama 2017-03-29 00:49:50 +00:00
parent c95671bd78
commit 6022b2be55
4 changed files with 6 additions and 8 deletions

View File

@ -444,10 +444,8 @@ static std::vector<SharedSymbol *> getSymbolsAt(SharedSymbol *SS) {
// debug. What's a solution? Instead of exporting a varaible V from a DSO,
// define an accessor getV().
template <class ELFT> static void addCopyRelSymbol(SharedSymbol *SS) {
typedef typename ELFT::uint uintX_t;
// Copy relocation against zero-sized symbol doesn't make sense.
uintX_t SymSize = SS->template getSize<ELFT>();
uint64_t SymSize = SS->template getSize<ELFT>();
if (SymSize == 0)
fatal("cannot create a copy relocation for symbol " + toString(*SS));
@ -455,7 +453,7 @@ template <class ELFT> static void addCopyRelSymbol(SharedSymbol *SS) {
// memory protection by reserving space in the .bss.rel.ro section.
bool IsReadOnly = isReadOnly<ELFT>(SS);
BssSection *Sec = IsReadOnly ? In<ELFT>::BssRelRo : In<ELFT>::Bss;
uintX_t Off = Sec->reserveSpace(SymSize, SS->getAlignment<ELFT>());
uint64_t Off = Sec->reserveSpace(SymSize, SS->getAlignment<ELFT>());
// Look through the DSO's dynamic symbol table for aliases and create a
// dynamic symbol for each one. This causes the copy relocation to correctly

View File

@ -240,7 +240,7 @@ public:
// CopyRelSec and CopyRelSecOff are significant only when NeedsCopy is true.
InputSection *CopyRelSec;
size_t CopyRelSecOff;
uint64_t CopyRelSecOff;
private:
template <class ELFT> const typename ELFT::Sym &getSym() const {

View File

@ -367,11 +367,11 @@ void BuildIdSection::computeHash(
BssSection::BssSection(StringRef Name)
: SyntheticSection(SHF_ALLOC | SHF_WRITE, SHT_NOBITS, 0, Name) {}
size_t BssSection::reserveSpace(size_t Size, uint32_t Alignment) {
size_t BssSection::reserveSpace(uint64_t Size, uint32_t Alignment) {
if (OutSec)
OutSec->updateAlignment(Alignment);
this->Size = alignTo(this->Size, Alignment) + Size;
this->Alignment = std::max<uint32_t>(this->Alignment, Alignment);
this->Alignment = std::max(this->Alignment, Alignment);
return this->Size - Size;
}

View File

@ -166,7 +166,7 @@ public:
size_t getSize() const override { return Size; }
private:
size_t Size = 0;
uint64_t Size = 0;
};
class MipsGotSection final : public SyntheticSection {