[PATCH] Preserve -fretain-comments-from-system-headers in modules

This patch preserves the setting of -fretain-comments-from-system-headers when building, storing and loading modules, which allows code completion to pick up documentation comments from system headers.

module-system-header-comments.patch (3.6 KB)

Looks good but making the flag part of the module hash requires a couple more changes.

See my commit r180635 where I do the same for the detailed-preprocessing-record flag.
Basically a PCH created with modules is pointing to the module file path, and the module hash is part of the path, so it is important the the module hash between the originating invocation and the PCH agree. That commit makes the flag significant when modules are enabled and rejects a PCH that didn't enable the flag.

Also the flag should be serialized (this is shown in r180635 as well).

I think that serialization is automatically handled for all options
defined in LangOptions.def (ASTWriter::WriteControlBlock). But
because this is a BENIGN_LANGOPT, ASTReader seems to skip checking
that they match.


Thanks for the feedback, I’ll look at that commit and make the suggested changes. Also: oops I meant this to go to cfe-commits, not cfe-dev. I’ll move the discussion there when I update this patch.