File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -53,8 +53,22 @@ void X86TargetMachine::registerPassBuilderCallbacks(
53
53
PassBuilder &PB, bool PopulateClassToPassNames) {
54
54
if (PopulateClassToPassNames) {
55
55
auto *PIC = PB.getPassInstrumentationCallbacks ();
56
- PIC->addClassToPassName (X86ISelDAGToDAGPass::name (), " x86-isel" );
56
+ #define MACHINE_FUNCTION_PASS (NAME, CREATE_PASS ) \
57
+ PIC->addClassToPassName (decltype (CREATE_PASS)::name (), NAME);
58
+ #include " X86PassRegistry.def"
57
59
}
60
+
61
+ PB.registerPipelineParsingCallback (
62
+ [this ](StringRef Name, MachineFunctionPassManager &MFPM,
63
+ ArrayRef<PassBuilder::PipelineElement>) {
64
+ #define MACHINE_FUNCTION_PASS (NAME, CREATE_PASS ) \
65
+ if (Name == NAME) { \
66
+ MFPM.addPass (CREATE_PASS); \
67
+ return true ; \
68
+ }
69
+ #include " X86PassRegistry.def"
70
+ return false ;
71
+ });
58
72
}
59
73
60
74
Error X86TargetMachine::buildCodeGenPipeline (
Original file line number Diff line number Diff line change
1
+ // ===- X86PassRegistry.def - Registry of X86 specific passes ----*- C++ -*-===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+ //
9
+ // This file is used as the registry of passes that are part of the X86 backend.
10
+ //
11
+ // ===----------------------------------------------------------------------===//
12
+
13
+ // NOTE: NO INCLUDE GUARD DESIRED!
14
+
15
+ #ifndef MACHINE_FUNCTION_PASS
16
+ #define MACHINE_FUNCTION_PASS (NAME, CREATE_PASS )
17
+ #endif
18
+ MACHINE_FUNCTION_PASS (X86ISelDAGToDAGPass, X86ISelDAGToDAGPass(*this ))
19
+ #undef MACHINE_FUNCTION_PASS
You can’t perform that action at this time.
0 commit comments