From: George Rimar Date: Sat, 9 Feb 2019 15:18:52 +0000 (+0000) Subject: [yaml2elf.cpp] - Fix compilation under linux. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=348c9aad78c1a05b80a0b93a43796dc65b5716ad;p=llvm [yaml2elf.cpp] - Fix compilation under linux. Fixes errors like: /home/ssglocal/clang-cmake-x86_64-sde-avx512-linux/clang-cmake-x86_64-sde-avx512-linux/llvm/tools/yaml2obj/yaml2elf.cpp:597:5: error: need ‘typename’ before ‘ELFT:: Xword’ because ‘ELFT’ is a dependent scope ELFT::Xword Tag = (ELFT::Xword)DE.Tag; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353614 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/yaml2obj/yaml2elf.cpp b/tools/yaml2obj/yaml2elf.cpp index 50644a997df..d5b1b59c254 100644 --- a/tools/yaml2obj/yaml2elf.cpp +++ b/tools/yaml2obj/yaml2elf.cpp @@ -582,11 +582,11 @@ template void ELFState::writeSectionContent(Elf_Shdr &SHeader, const ELFYAML::DynamicSection &Section, ContiguousBlobAccumulator &CBA) { - typedef typename ELFT::uint uintX_t; + typedef typename ELFT::Xword Xword; assert(Section.Type == llvm::ELF::SHT_DYNAMIC && "Section type is not SHT_DYNAMIC"); - SHeader.sh_size = 2 * sizeof(uintX_t) * Section.Entries.size(); + SHeader.sh_size = 2 * sizeof(typename ELFT::uint) * Section.Entries.size(); if (Section.EntSize) SHeader.sh_entsize = *Section.EntSize; else @@ -594,10 +594,10 @@ void ELFState::writeSectionContent(Elf_Shdr &SHeader, auto &OS = CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign); for (const ELFYAML::DynamicEntry &DE : Section.Entries) { - ELFT::Xword Tag = (ELFT::Xword)DE.Tag; - OS.write((const char *)&Tag, sizeof(ELFT::Xword)); - ELFT::Xword Val = (ELFT::Xword)DE.Val; - OS.write((const char *)&Val, sizeof(ELFT::Xword)); + Xword Tag = (Xword)DE.Tag; + OS.write((const char *)&Tag, sizeof(Xword)); + Xword Val = (Xword)DE.Val; + OS.write((const char *)&Val, sizeof(Xword)); } }