[llvm] 44794cd - [llvm-profgen] - Fix compilation issue after ELFFile<ELFT> interface update.

Georgii Rymar via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 05:09:51 PST 2020


Author: Georgii Rymar
Date: 2020-12-04T16:09:25+03:00
New Revision: 44794cde188fea364e0868f427ae824ad8b32f9c

URL: https://github.com/llvm/llvm-project/commit/44794cde188fea364e0868f427ae824ad8b32f9c
DIFF: https://github.com/llvm/llvm-project/commit/44794cde188fea364e0868f427ae824ad8b32f9c.diff

LOG: [llvm-profgen] - Fix compilation issue after ELFFile<ELFT> interface update.

`D92560` changed `ELFObjectFile::getELFFile` to return reference.

Added: 
    

Modified: 
    llvm/tools/llvm-profgen/ProfiledBinary.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
index 7ea17c2ea9a7..7cc318ccffa6 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 <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()))


        


More information about the llvm-commits mailing list