[clang] [llvm] [clang][Driver] Don't ignore -gmodules .gch files (PR #77711)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 01:19:38 PST 2024


zmodem wrote:

Thanks for looking into this. I wasn't aware of `-gmodules` relying on "gch probing" when I wrote the previous patch.

It seems unfortunate to make `maybeHasClangPchSignature` so broad as to return true for any file format that we recognize. Would it be possible to at least tighten it to only consider the kind of object files which could have a clangast section? Or is that list too long? What does the code that reads these files look like, could we leverage that somehow?

An alternative would be turn the logic around, and only ignore GCC PCH files (I believe they all start with the file magic `gpch`). However I do think that the current approach of "whitelisting" the kind of file we're looking for is better.

https://github.com/llvm/llvm-project/pull/77711


More information about the cfe-commits mailing list