Add rule-based args for C++20 modules #927
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.47) × (1 − Review Confidence (0.79)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 294 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.76 · 4 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.340
Real PR Conversation Timeline
9 items
Approved
Approved these changes.
i think these args would be after the input arg above, is that a problem? I know for header parsing this has to be first
should this be against the 1 feature instead of these separately?
Sure, done!
Good catch. -x only applies to later inputs: after the source, a .cc interface writes no BMI and a .cppm one only works by extension, with an unused-argument warning. It's now emitted with the source in compiler_input_flags (-x c++-module -c <source>), the way thin_lto does -x ir, so feature order can't break it.
Approved
Approved these changes.
Approved
Approved these changes.
Approved
Approved these changes.
fmeum
AustinSchuh
#750 added the C++20 module actions and variables to the rule-based toolchain API, but no args that use them, so every rule-based toolchain that builds modules writes its own. unix_cc_toolchain_config has them as features, and this brings rule-based toolchains up to parity.
Add //cc/toolchains/args/cpp_modules, with the cpp_modules feature Bazel requires before it builds module interfaces, and the clang args: the module map file, -x c++-module and -fmodule-output. Name the dependency scanner's output file in compiler_output_flags, where unix_cc_toolchain_config does. The args only apply to the module actions, so they join the legacy action config features; toolchains that map tools for those actions list cpp_modules as a known feature.
Tested with goldens in legacy_features_as_args, which match the features of the same names in unix_cc_toolchain_config. End to end, toolchains_llvm's rule-based darwin toolchain builds and runs C++20 module tests with these args.