<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Add an option to disable inline line tables similar to MSVC /Zo-"
   href="https://bugs.llvm.org/show_bug.cgi?id=42344">42344</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Add an option to disable inline line tables similar to MSVC /Zo-
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DebugInfo
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rnk@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>akhuang@google.com, dblaikie@gmail.com, jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The CodeView inline line tables that LLVM emits are large, and it even MSVC's
have long been a source of performance issues in tools that use DIA [1]. MSVC
has an option, /Zo- (formerly /d2Zi-), that disables the new optimized debug
info records added in a previous release. I think it would be helpful for clang
to have a similar option so that we can test various debugging use cases
(profiling, interactive debugging) with and without this information to see if
it causes performance or correctness issues. And, Bruce asked if such a flag
existed here [2].

[1]
<a href="https://randomascii.wordpress.com/2014/11/04/slow-symbol-loading-in-microsofts-profiler-take-two/">https://randomascii.wordpress.com/2014/11/04/slow-symbol-loading-in-microsofts-profiler-take-two/</a>
[2] <a href="https://crbug.com/965670#c10">https://crbug.com/965670#c10</a>

I think the MSVC /Zo- flag also disables the emission of the S_LOCAL /
S_DEFRANGE* family of records, but I don't think we want to implement that,
since I think that's still the only way that LLVM can emit variable location
information.

I think the simplest way to implement this, at least for CodeView, is to thread
the option through to CodeViewDebug.cpp and simply skip emission of the
S_INLINE_SITE records, along with the inlinees subsection. A more complete
implementation would also skip emitting the .cv_loc udpates and other related
inline source location tracking directives, but that may require more code
changes.

I don't see any reason not to also implement this option for DWARF, but the
line tables are tracked very differently, so perhaps it shouldn't be in the
initial version of this feature. DWARF uses a unified line table, I believe in
.debug_loc, so we'd need to update DwarfDebug::beginInstruction to look up
through inlinedAt locations so that we don't emit .loc directives referring to
the source file of the inlined function.

Finally, the middle-end has a lot of invariants about source locations, calls,
and inlinedAt locations, and I don't think we want to disturb that. That's why
I think this should be implemented in the backend.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>