From 44794cde188fea364e0868f427ae824ad8b32f9c Mon Sep 17 00:00:00 2001 From: Georgii Rymar Date: Fri, 4 Dec 2020 16:09:25 +0300 Subject: [PATCH] [llvm-profgen] - Fix compilation issue after ELFFile interface update. `D92560` changed `ELFObjectFile::getELFFile` to return reference. --- llvm/tools/llvm-profgen/ProfiledBinary.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp index 7ea17c2..7cc318c 100644 --- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp +++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp @@ -43,12 +43,12 @@ static const Target *getTarget(const ObjectFile *Obj) { } template -static uint64_t getELFImageLMAForSec(const ELFFile *Obj, +static uint64_t getELFImageLMAForSec(const ELFFile &Obj, const object::ELFSectionRef &Sec, StringRef FileName) { // Search for a PT_LOAD segment containing the requested section. Return this // segment's p_addr as the image load address for the section. - const auto &PhdrRange = unwrapOrError(Obj->program_headers(), FileName); + const auto &PhdrRange = unwrapOrError(Obj.program_headers(), FileName); for (const typename ELFT::Phdr &Phdr : PhdrRange) if ((Phdr.p_type == ELF::PT_LOAD) && (Phdr.p_vaddr <= Sec.getAddress()) && (Phdr.p_vaddr + Phdr.p_memsz > Sec.getAddress())) -- 2.7.4