Page MenuHomePhabricator

[perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"
ClosedPublic

Authored by sylvestre.ledru on Mar 10 2019, 8:57 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2019, 8:57 AM

The build is broken with:

{anonymous}::PerfJITEventListener::notifyObjectLoaded(llvm::JITEventListener::ObjectKey, const llvm::object::ObjectFile&, const llvm::RuntimeDyld::LoadedObjectInfo&)':
/build/llvm-toolchain-snapshot-9~svn355786/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp:274:55: error: no matching function for call to 'llvm::DIContext::getLineInfoForAddressRange(uint64_t&, uint64_t&, llvm::DILineInfoSpecifier::FileLineInfoKind)'
         Addr, Size, FileLineInfoKind::AbsoluteFilePath);
                                                       ^
In file included from /build/llvm-toolchain-snapshot-9~svn355786/include/llvm/DebugInfo/DWARF/DWARFContext.h:18:0,
                 from /build/llvm-toolchain-snapshot-9~svn355786/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp:20:
/build/llvm-toolchain-snapshot-9~svn355786/include/llvm/DebugInfo/DIContext.h:209:27: note: candidate: virtual llvm::DILineInfoTable llvm::DIContext::getLineInfoForAddressRange(llvm::object::SectionedAddress, uint64_t, llvm::DILineInfoSpecifier)
   virtual DILineInfoTable getLineInfoForAddressRange(
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
/build/llvm-toolchain-snapshot-9~svn355786/include/llvm/DebugInfo/DIContext.h:209:27: note:   no known conversion for argument 1 from 'uint64_t {aka long unsigned int}' to 'llvm::object::SectionedAddress'
avl added a comment.Mar 11 2019, 3:56 AM

Oh I missed perf jit case, excuse me...

Could you set SectionIndex also, please ? The same way how it is done in https://reviews.llvm.org/D58959 :

uint64_t SectionIndex = object::SectionedAddress::UndefSection;
if (auto SectOrErr = Sym.getSection())
  if (*SectOrErr != Obj.section_end())
    SectionIndex = SectOrErr.get()->getIndex();

DILineInfoTable Lines = Context->getLineInfoForAddressRange(
    {*AddrOrErr, SectionIndex}, Size, FileLineInfoKind::AbsoluteFilePath);

Also set SectionIndex

Remove an unrelated change

avl added a comment.Mar 13 2019, 12:57 PM

This looks OK for me(taking into account the comment). Let final approve would be done by David, since He reviewed original patch.
David, Is it OK for you ?

lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
270 ↗(On Diff #190454)

above two lines are not necessary.

avl added a comment.Mar 16 2019, 8:18 AM

Since that is compile time issue - not neccessary to delay it for long time. LGTM.

avl accepted this revision.Mar 16 2019, 8:18 AM
This revision is now accepted and ready to land.Mar 16 2019, 8:18 AM

Friendly ping, @sylvestre.ledru! I'm also experiencing this build error. It looks like other diffs have been submitted to fix this, such as https://reviews.llvm.org/D59162, but it was abandoned in favor of this patch. It'd be great if you could commit this one.

This revision was automatically updated to reflect the committed changes.

Sorry for the latency, I didn't receive the notification :/