Pass Module Analysis Manager to Standard Instrumentations
This commit is contained in:
parent
b5117538e9
commit
afb7eef79a
1 changed files with 6 additions and 5 deletions
|
@ -732,12 +732,7 @@ extern "C" LLVMRustResult LLVMRustOptimize(
|
||||||
PTO.SLPVectorization = SLPVectorize;
|
PTO.SLPVectorization = SLPVectorize;
|
||||||
PTO.MergeFunctions = MergeFunctions;
|
PTO.MergeFunctions = MergeFunctions;
|
||||||
|
|
||||||
// FIXME: We may want to expose this as an option.
|
|
||||||
bool DebugPassManager = false;
|
|
||||||
|
|
||||||
PassInstrumentationCallbacks PIC;
|
PassInstrumentationCallbacks PIC;
|
||||||
StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
|
|
||||||
SI.registerCallbacks(PIC);
|
|
||||||
|
|
||||||
if (LlvmSelfProfiler) {
|
if (LlvmSelfProfiler) {
|
||||||
LLVMSelfProfileInitializeCallbacks(PIC, LlvmSelfProfiler,
|
LLVMSelfProfileInitializeCallbacks(PIC, LlvmSelfProfiler,
|
||||||
|
@ -784,6 +779,12 @@ extern "C" LLVMRustResult LLVMRustOptimize(
|
||||||
CGSCCAnalysisManager CGAM;
|
CGSCCAnalysisManager CGAM;
|
||||||
ModuleAnalysisManager MAM;
|
ModuleAnalysisManager MAM;
|
||||||
|
|
||||||
|
// FIXME: We may want to expose this as an option.
|
||||||
|
bool DebugPassManager = false;
|
||||||
|
|
||||||
|
StandardInstrumentations SI(TheModule->getContext(), DebugPassManager);
|
||||||
|
SI.registerCallbacks(PIC, &MAM);
|
||||||
|
|
||||||
if (LLVMPluginsLen) {
|
if (LLVMPluginsLen) {
|
||||||
auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
|
auto PluginsStr = StringRef(LLVMPlugins, LLVMPluginsLen);
|
||||||
SmallVector<StringRef> Plugins;
|
SmallVector<StringRef> Plugins;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue