@@ -713,7 +713,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(
713
713
LLVMModuleRef ModuleRef, LLVMTargetMachineRef TMRef,
714
714
LLVMRustPassBuilderOptLevel OptLevelRust, LLVMRustOptStage OptStage,
715
715
bool IsLinkerPluginLTO, bool NoPrepopulatePasses, bool VerifyIR,
716
- bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops,
716
+ bool LintIR, bool UseThinLTOBuffers, bool MergeFunctions, bool UnrollLoops,
717
717
bool SLPVectorize, bool LoopVectorize, bool DisableSimplifyLibCalls,
718
718
bool EmitLifetimeMarkers, LLVMRustSanitizerOptions *SanitizerOptions,
719
719
const char *PGOGenPath, const char *PGOUsePath, bool InstrumentCoverage,
@@ -842,6 +842,13 @@ extern "C" LLVMRustResult LLVMRustOptimize(
842
842
});
843
843
}
844
844
845
+ if (LintIR) {
846
+ PipelineStartEPCallbacks.push_back (
847
+ [](ModulePassManager &MPM, OptimizationLevel Level) {
848
+ MPM.addPass (createModuleToFunctionPassAdaptor (LintPass ()));
849
+ });
850
+ }
851
+
845
852
if (InstrumentGCOV) {
846
853
PipelineStartEPCallbacks.push_back (
847
854
[](ModulePassManager &MPM, OptimizationLevel Level) {
0 commit comments