[llvm] r353614 - [yaml2elf.cpp] - Fix compilation under linux.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 9 07:18:52 PST 2019
Author: grimar
Date: Sat Feb 9 07:18:52 2019
New Revision: 353614
URL: http://llvm.org/viewvc/llvm-project?rev=353614&view=rev
Log:
[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;
Modified:
llvm/trunk/tools/yaml2obj/yaml2elf.cpp
Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=353614&r1=353613&r2=353614&view=diff
==============================================================================
--- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
+++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Sat Feb 9 07:18:52 2019
@@ -582,11 +582,11 @@ template <class ELFT>
void ELFState<ELFT>::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<ELFT>::writeSectionContent
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));
}
}
More information about the llvm-commits
mailing list