[llvm] r356542 - [perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

Sylvestre Ledru via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 03:02:19 PDT 2019


Author: sylvestre
Date: Wed Mar 20 03:02:18 2019
New Revision: 356542

URL: http://llvm.org/viewvc/llvm-project?rev=356542&view=rev
Log:
[perf][DebugInfo] follow up for "add SectionedAddress to DebugInfo interfaces"

Summary: Fix the build failure when perf jit is enabled

Reviewers: avl, dblaikie

Reviewed By: avl

Subscribers: modocache, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59189

Modified:
    llvm/trunk/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp

Modified: llvm/trunk/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp?rev=356542&r1=356541&r2=356542&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp Wed Mar 20 03:02:18 2019
@@ -265,16 +265,22 @@ void PerfJITEventListener::notifyObjectL
       consumeError(AddrOrErr.takeError());
       continue;
     }
-    uint64_t Addr = *AddrOrErr;
     uint64_t Size = P.second;
+    object::SectionedAddress Address;
+    Address.Address = *AddrOrErr;
+
+    uint64_t SectionIndex = object::SectionedAddress::UndefSection;
+    if (auto SectOrErr = Sym.getSection())
+        if (*SectOrErr != Obj.section_end())
+            SectionIndex = SectOrErr.get()->getIndex();
 
     // According to spec debugging info has to come before loading the
     // corresonding code load.
     DILineInfoTable Lines = Context->getLineInfoForAddressRange(
-        Addr, Size, FileLineInfoKind::AbsoluteFilePath);
+        {*AddrOrErr, SectionIndex}, Size, FileLineInfoKind::AbsoluteFilePath);
 
-    NotifyDebug(Addr, Lines);
-    NotifyCode(Name, Addr, Size);
+    NotifyDebug(*AddrOrErr, Lines);
+    NotifyCode(Name, *AddrOrErr, Size);
   }
 
   Dumpstream->flush();




More information about the llvm-commits mailing list