Open wolfy1961 opened 4 years ago
It's causing compile time slow down for one of our licensees across thousands of headers. It seems to me that the source information should be available from the AST so that the header does not need to be reopened.
Not entirely clear if this is a bug, though - what problem does this cause/what do you expect to happen instead?
On a Windows hosted compiler the read can be observed with ProcMon.
Extended Description
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