diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-07-20 05:08:02 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-07-20 05:08:02 +0000 |
| commit | c3175802c51fceae995640b1c1e50b648834f9af (patch) | |
| tree | f13dfba697a518dcfb1b15150736c73eb4b04b03 /compiler/rustc_llvm/llvm-wrapper | |
| parent | 329fda0bc9be49a2107023ccca58fc67cd3d18b4 (diff) | |
| parent | 6707bf0f59485cf054ac1095725df43220e4be20 (diff) | |
| download | rust-c3175802c51fceae995640b1c1e50b648834f9af.tar.gz rust-c3175802c51fceae995640b1c1e50b648834f9af.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index cc33764e485..a69057145f1 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -700,6 +700,10 @@ struct LLVMRustSanitizerOptions { #ifdef ENZYME extern "C" void registerEnzymeAndPassPipeline(llvm::PassBuilder &PB, /* augmentPassBuilder */ bool); + +extern "C" { +extern llvm::cl::opt<std::string> EnzymeFunctionToAnalyze; +} #endif extern "C" LLVMRustResult LLVMRustOptimize( @@ -1069,6 +1073,15 @@ extern "C" LLVMRustResult LLVMRustOptimize( return LLVMRustResult::Failure; } + // Check if PrintTAFn was used and add type analysis pass if needed + if (!EnzymeFunctionToAnalyze.empty()) { + if (auto Err = PB.parsePassPipeline(MPM, "print-type-analysis")) { + std::string ErrMsg = toString(std::move(Err)); + LLVMRustSetLastError(ErrMsg.c_str()); + return LLVMRustResult::Failure; + } + } + if (PrintAfterEnzyme) { // Handle the Rust flag `-Zautodiff=PrintModAfter`. std::string Banner = "Module after EnzymeNewPM"; |
