Use uint64_t instead of uintX_t where the larger type just works.

llvm-svn: 296162
This commit is contained in:
Rui Ueyama 2017-02-24 19:52:52 +00:00
parent 004d5245c0
commit 9cc84384ad
2 changed files with 7 additions and 9 deletions

View File

@ -94,7 +94,7 @@ template <class ELFT> void elf::ObjectFile<ELFT>::initializeDwarfLine() {
// 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(const Elf_Shdr &Sec) {
// 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>::createSymbolBody(const Elf_Sym *Sym) {
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<ELFT>::parseSoName() {
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);

View File

@ -138,7 +138,6 @@ template <class ELFT> class ObjectFile : public ELFFileBase<ELFT> {
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 : public ELFFileBase<ELFT> {
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;