[PATCH] D69778: Make -fmodules-codegen and -fmodules-debuginfo work also with precompiled headers

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 17 20:00:00 PDT 2020


dblaikie added a comment.

In D69778#1927761 <https://reviews.llvm.org/D69778#1927761>, @llunak wrote:

> In D69778#1927526 <https://reviews.llvm.org/D69778#1927526>, @dblaikie wrote:
>
> > @rnk  - know anything about the history of -building-pch-with-obj and whether it could be replaced/merged with -fmodules-codegen? (-fmodules-codegen + -fmodules-debuginfo, perhaps?)
>
>
> It comes from 08c5a7b8fda1b97df9d027d1ac096f93edeb6c2f . AFAICT -fmodules-codegen is a superset of -building-pch-with-obj, the important difference is that -building-pch-with-obj decides which code will be shared while building TUs, while -fmodules-codegen decides while building the PCH.


I'm not sure I follow - how would that be possible? building the object from the PCH is done independently of any usage, so it can't depend on the way the PCH is used by any TU that includes it, I think?

Hmm, yeah, seems it's not context-sensitive (actually Hans says on the original review it is context sensitive - but in the reverse: it ensures that /unreferenced/ dllexported functions are exported), but it is dllexport sensitive. So that's probably enough to not make this generalizable - seems I did ask these questions back when the feature was reviewed: https://reviews.llvm.org/D48426 & I'd forgotten. Sorry about that. Seems there's not much/nothing to do here - the two features are similar, but sufficiently different. ( @hans in case he's got any thoughts here)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69778/new/

https://reviews.llvm.org/D69778





More information about the cfe-commits mailing list