<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 - [PCH] contents of header file is fully read with -g despite compiling with pch"
   href="https://bugs.llvm.org/show_bug.cgi?id=47773">47773</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PCH] contents of header file is fully read with -g despite compiling with pch
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Wolfgang_Pieb@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24037" name="attach_24037" title="Test case">attachment 24037</a> <a href="attachment.cgi?id=24037&action=edit" title="Test case">[details]</a></span>
Test case

With -g the frontend seems to read the contents of a header file in its
entirety even when compiling with pch. This happens as part of the effort to
establish source locations for entities (a type in the attached test case) for
which debug locations are emitted. SourceManager::getPresumedLoc() attempts to
compute line numbers and in the process reads the header file.

The attached test case is for linux and uses the utility inotifywait to
demonstrate the file access (a stat call does not trigger a notification BTW,
only a read).

Set CLANG to a recently built clang and do

make; make all</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>