Skip to content

Commit afb7eef

Browse files
author
Aleksei Romanov
committed
Pass Module Analysis Manager to Standard Instrumentations
1 parent b511753 commit afb7eef

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)