Skip to content

Commit c6b784d

Browse files
authored
Rollup merge of rust-lang#130850 - saveasguy:pass-mam-to-standrd-instrumentations, r=nikic
Pass Module Analysis Manager to Standard Instrumentations This PR introduces changes related to llvm::PassInstrumentationCallbacks. Now, we pass Module Analysis Manager to StandardInstrumentations::registerCallbacks, so it can take advantage of such instrumentations as IR verifier or preserved CFG checker. So basically this is NFC PR.
2 parents 886a77b + afb7eef commit c6b784d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(
732732
PTO.SLPVectorization = SLPVectorize;
733733
PTO.MergeFunctions = MergeFunctions;
734734

735-
// FIXME: We may want to expose this as an option.
736-
bool DebugPassManager = false;
737-
738735
PassInstrumentationCallbacks PIC;
739-
StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
740-
SI.registerCallbacks(PIC);
741736

742737
if (LlvmSelfProfiler) {
743738
LLVMSelfProfileInitializeCallbacks(PIC, LlvmSelfProfiler,
@@ -784,6 +779,12 @@ extern "C" LLVMRustResult LLVMRustOptimize(
784779
CGSCCAnalysisManager CGAM;
785780
ModuleAnalysisManager MAM;
786781

782+
// FIXME: We may want to expose this as an option.
783+
bool DebugPassManager = false;
784+
785+
StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
786+
SI.registerCallbacks(PIC, &MAM);
787+
787788
if (LLVMPluginsLen) {
788789
auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
789790
SmallVector<StringRef> Plugins;

0 commit comments

Comments
 (0)