/// desired. Also that the analysis manager may be null if there is no
/// analysis manager in the pass pipeline.
virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) = 0;
+
+ /// \brief Polymorphic method to access the name of a pass.
+ virtual StringRef name() = 0;
};
/// \brief SFINAE metafunction for computing whether \c PassT has a run method
virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) {
return Pass.run(IR, AM);
}
+ virtual StringRef name() { return PassT::name(); }
PassT Pass;
};
virtual PreservedAnalyses run(IRUnitT IR, AnalysisManagerT *AM) {
return Pass.run(IR);
}
+ virtual StringRef name() { return PassT::name(); }
PassT Pass;
};
Passes.push_back(new ModulePassModel<ModulePassT>(llvm_move(Pass)));
}
+ static StringRef name() { return "ModulePassManager"; }
+
private:
// Pull in the concept type and model template specialized for modules.
typedef detail::PassConcept<Module *, ModuleAnalysisManager> ModulePassConcept;
PreservedAnalyses run(Function *F, FunctionAnalysisManager *AM = 0);
+ static StringRef name() { return "FunctionPassManager"; }
+
private:
// Pull in the concept type and model template specialized for functions.
typedef detail::PassConcept<Function *, FunctionAnalysisManager>
return PA;
}
+ static StringRef name() { return "ModuleToFunctionPassAdaptor"; }
+
private:
FunctionPassT Pass;
};