14 #ifndef MLIR_PASS_PASSREGISTRY_H_ 15 #define MLIR_PASS_PASSREGISTRY_H_ 27 std::function<LogicalResult(OpPassManager &, StringRef options)>;
47 "cannot call addToPipeline on PassRegistryEntry without builder");
48 return builder(pm, options);
61 : arg(arg), description(description), builder(builder) {}
68 StringRef description;
87 PassInfo(StringRef arg, StringRef description,
const PassID *passID,
119 registerPass(arg, description, PassID::getID<ConcretePass>(), constructor);
124 [] {
return std::make_unique<ConcretePass>(); }) {}
140 template <
typename Options = EmptyPipelineOptions>
143 StringRef arg, StringRef description,
144 std::function<
void(
OpPassManager &,
const Options &options)> builder) {
148 if (
failed(options.parseFromString(optionsStr)))
150 builder(pm, options);
163 if (!optionsStr.empty())
176 raw_ostream &errorStream = llvm::errs());
183 struct PassPipelineCLParserImpl;
199 bool hasAnyOccurrences()
const;
211 std::unique_ptr<detail::PassPipelineCLParserImpl> impl;
216 #endif // MLIR_PASS_PASSREGISTRY_H_ Definition: InferTypeOpInterface.cpp:20
Definition: STLExtras.h:95
void registerPassPipeline(StringRef arg, StringRef description, const PassRegistryFunction &function)
Definition: PassRegistry.cpp:42
std::function< LogicalResult(OpPassManager &, StringRef options)> PassRegistryFunction
Definition: PassRegistry.h:27
bool failed(LogicalResult result)
Definition: LogicalResult.h:45
StringRef getPassArgument() const
Definition: PassRegistry.h:53
PassPipelineInfo(StringRef arg, StringRef description, const PassRegistryFunction &builder)
Definition: PassRegistry.h:77
LogicalResult success(bool isSuccess=true)
Definition: LogicalResult.h:25
Definition: LogicalResult.h:18
LogicalResult failure(bool isFailure=true)
Definition: LogicalResult.h:32
PassRegistryEntry(StringRef arg, StringRef description, const PassRegistryFunction &builder)
Definition: PassRegistry.h:59
Definition: PassOptions.h:234
PassRegistration(StringRef arg, StringRef description, const PassAllocatorFunction &constructor)
Definition: PassRegistry.h:117
LogicalResult addToPipeline(OpPassManager &pm, StringRef options) const
Definition: PassRegistry.h:45
std::function< std::unique_ptr< Pass >()> PassAllocatorFunction
Definition: PassRegistry.h:28
PassRegistration(StringRef arg, StringRef description)
Definition: PassRegistry.h:122
A structure to represent the information of a registered pass pipeline.
Definition: PassRegistry.h:75
void registerPass(StringRef arg, StringRef description, const PassID *passID, const PassAllocatorFunction &function)
Definition: PassRegistry.cpp:58
Definition: PassRegistry.h:141
A structure to represent the information for a derived pass class.
Definition: PassRegistry.h:83
LogicalResult parsePassPipeline(StringRef pipeline, OpPassManager &pm, raw_ostream &errorStream=llvm::errs())
Definition: PassRegistry.cpp:377
Definition: PassRegistry.h:115
PassPipelineRegistration(StringRef arg, StringRef description, std::function< void(OpPassManager &)> builder)
Definition: PassRegistry.h:159
Definition: PassRegistry.h:40
PassPipelineRegistration(StringRef arg, StringRef description, std::function< void(OpPassManager &, const Options &options)> builder)
Definition: PassRegistry.h:142
StringRef getPassDescription() const
Returns a description for the pass, this never returns null.
Definition: PassRegistry.h:56
Definition: PassManager.h:44
Definition: PassRegistry.h:192