diff --git a/llvm/lib/ObjectYAML/ELFEmitter.cpp b/llvm/lib/ObjectYAML/ELFEmitter.cpp index cc41bbe6bbde2..9ae76a71ede5e 100644 --- a/llvm/lib/ObjectYAML/ELFEmitter.cpp +++ b/llvm/lib/ObjectYAML/ELFEmitter.cpp @@ -536,15 +536,11 @@ void ELFState::writeELFHeader(raw_ostream &OS) { template void ELFState::initProgramHeaders(std::vector &PHeaders) { - DenseMap NameToFill; DenseMap NameToIndex; for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) { - if (auto S = dyn_cast(Doc.Chunks[I].get())) - NameToFill[S->Name] = S; NameToIndex[Doc.Chunks[I]->Name] = I + 1; } - std::vector Sections = Doc.getSections(); for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) { ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I]; Elf_Phdr Phdr;