[llvm-profgen] - Fix compilation issue after ELFFile<ELFT> interface update.
authorGeorgii Rymar <grimar@accesssoftek.com>
Fri, 4 Dec 2020 13:09:25 +0000 (16:09 +0300)
committerGeorgii Rymar <grimar@accesssoftek.com>
Fri, 4 Dec 2020 13:09:25 +0000 (16:09 +0300)
`D92560` changed `ELFObjectFile::getELFFile` to return reference.

llvm/tools/llvm-profgen/ProfiledBinary.cpp

index 7ea17c2..7cc318c 100644 (file)
@@ -43,12 +43,12 @@ static const Target *getTarget(const ObjectFile *Obj) {
 }
 
 template <class ELFT>
-static uint64_t getELFImageLMAForSec(const ELFFile<ELFT> *Obj,
+static uint64_t getELFImageLMAForSec(const ELFFile<ELFT> &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()))