diff options
| author | Jana Dönszelmann <jonathan@donsz.nl> | 2025-06-25 22:14:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-25 22:14:55 +0200 |
| commit | 69b11c64ebf9798984f8ceb250cb1b755488aaf1 (patch) | |
| tree | e1b74e2accefb185ea36ca3d9478c78ca05f518c /compiler/rustc_mir_transform/src/coverage/tests.rs | |
| parent | 63c5a84b74091970026e9ff023ff4ba1fe01db44 (diff) | |
| parent | 7b1c89f2b58515bba671de38ba974edb58429973 (diff) | |
| download | rust-69b11c64ebf9798984f8ceb250cb1b755488aaf1.tar.gz rust-69b11c64ebf9798984f8ceb250cb1b755488aaf1.zip | |
Rollup merge of #142809 - KMJ-007:ad-type-analysis-flag, r=ZuseZ4
Add PrintTAFn flag for targeted type analysis printing ## Summary This PR adds a new `PrintTAFn` flag to the `-Z autodiff` option that allows printing type analysis information for a specific function, rather than all functions. ## Changes ### New Flag - Added `PrintTAFn=<function_name>` option to `-Z autodiff` - Usage: `-Z autodiff=Enable,PrintTAFn=my_function_name` ### Implementation Details - **Rust side**: Added `PrintTAFn(String)` variant to `AutoDiff` enum - **Parser**: Updated `parse_autodiff` to handle `PrintTAFn=<function_name>` syntax with proper error handling - **FFI**: Added `set_print_type_fun` function to interface with Enzyme's `FunctionToAnalyze` command line option - **Documentation**: Updated help text and documentation for the new flag ### Files Modified - `compiler/rustc_session/src/config.rs`: Added `PrintTAFn(String)` variant - `compiler/rustc_session/src/options.rs`: Updated parser and help text (now shows `PrintTAFn` in the list) - `compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs`: Added FFI function and static variable - `compiler/rustc_codegen_llvm/src/back/lto.rs`: Added handling for new flag - `src/doc/rustc-dev-guide/src/autodiff/flags.md`: Updated documentation - `src/doc/unstable-book/src/compiler-flags/autodiff.md`: Updated documentation ## Testing The flag can be tested with: ```bash rustc +enzyme -Z autodiff=Enable,PrintTAFn=square test.rs ``` This will print type analysis information only for the function named "square" instead of all functions. ## Error Handling The parser includes proper error handling: - Missing argument: `PrintTAFn` without `=<function_name>` will show an error - Unknown options: Invalid autodiff options will be reported r? ```@ZuseZ4```
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/tests.rs')
0 files changed, 0 insertions, 0 deletions
