LLVM 23.0.0git
SandboxVectorizerPassBuilder.cpp
Go to the documentation of this file.
2
16
17namespace llvm::sandboxir {
18
19std::unique_ptr<sandboxir::RegionPass>
21 StringRef AuxArg) {
22#define REGION_PASS(NAME, CLASS_NAME) \
23 if (Name == NAME) { \
24 assert(Args.empty() && "Unexpected arguments for pass '" NAME "'."); \
25 return std::make_unique<CLASS_NAME>(AuxArg); \
26 }
27// TODO: Support region passes with params.
28#include "Passes/PassRegistry.def"
29 return nullptr;
30}
31
32std::unique_ptr<sandboxir::FunctionPass>
34 StringRef AuxArg) {
35#define FUNCTION_PASS_WITH_PARAMS(NAME, CLASS_NAME) \
36 if (Name == NAME) \
37 return std::make_unique<CLASS_NAME>(Args, AuxArg);
38#include "Passes/PassRegistry.def"
39 return nullptr;
40}
41
42} // namespace llvm::sandboxir
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
static LLVM_ABI std::unique_ptr< RegionPass > createRegionPass(StringRef Name, StringRef Args, StringRef AuxArg)
static LLVM_ABI std::unique_ptr< FunctionPass > createFunctionPass(StringRef Name, StringRef Args, StringRef AuxArg)