<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 12, 2017 at 10:42 PM Dean Michael Berris via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">dberris created this revision.<br>
Herald added a subscriber: aprantl.<br>
<br>
XRay had been assuming that the previous section is the "text" section<br>
of the function. Unfortunately for in-lined functions where we're also<br>
generating the comdat definition for debugging purposes, we may be<br>
coming from a section that isn't "text" (could be .zdebug_types).<br></blockquote><div><br>This statement "unfortunately for in-lined functions where we're also generating the comdat definition for debugging purposes" is still confusing to me - I don't think this has anything to do with comdats.<br><br>Indeed I think the test case you mentioned having had no inline functions at all - just that if type units are enabled and any debug types are emitted during endFunction, then that causes a switch to the debug_types section, rather than the text section. (most of the DWARF emission is delayed - we mostly don't switch to DWARF sections and produce DWARF bytes until the end of the module - except for type units, since they're whole/complete by themselves the moment we emit the type, so for those we do it immediately - causing section changes)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
This fixes an issue with combining -gsplit-dwarf and -fxray-instrument<br>
for functions inlined, where the original definition may be lowered<br>
into the debug sections. When the debug section is stripped, we're<br>
left with references from the xray_instr_map to the debug section. The<br>
change now uses the function's symbol instead of the previous<br>
section's start symbol.<br>
<br>
<br>
<a href="https://reviews.llvm.org/D37791" rel="noreferrer" target="_blank">https://reviews.llvm.org/D37791</a><br>
<br>
Files:<br>
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
<br>
<br>
Index: lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
===================================================================<br>
--- lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
+++ lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br>
@@ -2785,7 +2785,7 @@<br>
   MCSection *InstMap = nullptr;<br>
   MCSection *FnSledIndex = nullptr;<br>
   if (MF->getSubtarget().getTargetTriple().isOSBinFormatELF()) {<br>
-    auto Associated = dyn_cast<MCSymbolELF>(PrevSection->getBeginSymbol());<br>
+    auto Associated = dyn_cast<MCSymbolELF>(CurrentFnSym);<br>
     assert(Associated != nullptr);<br>
     auto Flags = ELF::SHF_WRITE | ELF::SHF_ALLOC | ELF::SHF_LINK_ORDER;<br>
     std::string GroupName;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>