Commit 1855ab6
committed
Support C++20 modules in the rules-based toolchain API
The rules-based cc/toolchains toolchain API was missing several pieces
needed to drive Bazel's C++20 modules pipeline (clang-scan-deps -> .ddi
-> aggregate-ddi -> generate-modmap -> module compile):
- Add a cpp20_module_actions action type set grouping the module
interface compile, codegen and dependency scanning actions. These are
deliberately kept out of compile_actions/source_compile_actions so that
flags incompatible with C++20 modules can keep targeting only the
non-module compiles.
- Register the cpp_module_output_file and cpp_module_modmap_file build
variables and make dependency_file, output_file, source_file and
user_compile_flags available to the C++20 module actions.
- Include the C++20 module actions in the compiler_files legacy file
group so their tools (e.g. the dependency scanner) are available to the
compile actions.
- Fix _create_scan_deps_action to pass needs_include_validation and to
not request a .d dotd file (the scanner emits a P1689 .ddi file), and
let _create_compile_action forward the C++20 module output/modmap
arguments to the underlying action.1 parent 6072dab commit 1855ab6
4 files changed
Lines changed: 78 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
| 531 | + | |
530 | 532 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | 533 | | |
546 | 534 | | |
547 | 535 | | |
| |||
579 | 567 | | |
580 | 568 | | |
581 | 569 | | |
| 570 | + | |
582 | 571 | | |
583 | 572 | | |
584 | 573 | | |
| |||
2319 | 2308 | | |
2320 | 2309 | | |
2321 | 2310 | | |
2322 | | - | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
2323 | 2316 | | |
2324 | 2317 | | |
2325 | 2318 | | |
2326 | 2319 | | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
2327 | 2329 | | |
2328 | 2330 | | |
2329 | 2331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
275 | 300 | | |
276 | 301 | | |
277 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
5 | 21 | | |
6 | 22 | | |
7 | 23 | | |
| |||
19 | 35 | | |
20 | 36 | | |
21 | 37 | | |
22 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
23 | 42 | | |
24 | 43 | | |
25 | 44 | | |
| |||
412 | 431 | | |
413 | 432 | | |
414 | 433 | | |
| 434 | + | |
415 | 435 | | |
416 | 436 | | |
417 | 437 | | |
| |||
473 | 493 | | |
474 | 494 | | |
475 | 495 | | |
476 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
477 | 500 | | |
478 | 501 | | |
479 | 502 | | |
| |||
554 | 577 | | |
555 | 578 | | |
556 | 579 | | |
557 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
558 | 584 | | |
559 | 585 | | |
560 | 586 | | |
| |||
569 | 595 | | |
570 | 596 | | |
571 | 597 | | |
| 598 | + | |
| 599 | + | |
572 | 600 | | |
573 | 601 | | |
574 | 602 | | |
| |||
0 commit comments