-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[C++20] [Modules] Offer -fmodules-embed-all-files option #107194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3162,6 +3162,12 @@ def modules_reduced_bmi : Flag<["-"], "fexperimental-modules-reduced-bmi">, | |
HelpText<"Generate the reduced BMI">, | ||
MarshallingInfoFlag<FrontendOpts<"GenReducedBMI">>; | ||
|
||
def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved the position since the original position is enclosed by a group assigning the CC1Option. |
||
Visibility<[ClangOption, CC1Option, CLOption]>, | ||
HelpText<"Embed the contents of all files read by this compilation into " | ||
"the produced module file.">, | ||
MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>; | ||
|
||
def fmodules_prune_interval : Joined<["-"], "fmodules-prune-interval=">, Group<i_Group>, | ||
Visibility<[ClangOption, CC1Option]>, MetaVarName<"<seconds>">, | ||
HelpText<"Specify the interval (in seconds) between attempts to prune the module cache">, | ||
|
@@ -7665,10 +7671,6 @@ def fmodules_embed_file_EQ : Joined<["-"], "fmodules-embed-file=">, | |
HelpText<"Embed the contents of the specified file into the module file " | ||
"being compiled.">, | ||
MarshallingInfoStringVector<FrontendOpts<"ModulesEmbedFiles">>; | ||
def fmodules_embed_all_files : Joined<["-"], "fmodules-embed-all-files">, | ||
HelpText<"Embed the contents of all files read by this compilation into " | ||
"the produced module file.">, | ||
MarshallingInfoFlag<FrontendOpts<"ModulesEmbedAllFiles">>; | ||
defm fimplicit_modules_use_lock : BoolOption<"f", "implicit-modules-use-lock", | ||
FrontendOpts<"BuildingImplicitModuleUsesLock">, DefaultTrue, | ||
NegFlag<SetFalse>, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// RUN: %clang -std=c++20 %s -fmodules-embed-all-files -### 2>&1 | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd appreciate a second There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
// CHECK: -fmodules-embed-all-files | ||
|
||
// RUN: %clang -std=c++20 %s -### 2>&1 | FileCheck %s --check-prefix=NON-EMBED | ||
// NON-EMBED-NOT: -fmodules-embed-all-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might expand on this a bit with something like, "While the
-fmodules_embed_all_files
flag explicitly emits the source code into the BMI file, the contents of the BMI file contain a sufficiently verbose(word choice?) representation to reproduce the original source file."I'd like to make this warning as clear as possible: If you ship a BMI, you mind as well just ship the source code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done by adding the suggested text to the above section about
-fmodules-embed-all-files
. I feel it is odd to mention-fmodules-embed-all-files
in the current section since it is mostly about clarifying that hiding information is not a goal for BMIs. It is true with and without-fmodules-embed-all-files
.