File tree Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Expand file tree Collapse file tree 2 files changed +23
-13
lines changed Original file line number Diff line number Diff line change
1
+ //===- DirectXPassRegistry.def - Registry of DirectX 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
10
+ // DirectX backend.
11
+ //
12
+ //===----------------------------------------------------------------------===//
13
+
14
+ // NOTE: NO INCLUDE GUARD DESIRED!
15
+
16
+ #ifndef MODULE_PASS
17
+ #define MODULE_PASS(NAME, CREATE_PASS)
18
+ #endif
19
+ MODULE_PASS("print-dx-shader-flags", DXILResourcePrinterPass(dbgs()))
20
+ MODULE_PASS("print-dxil-resource", DXILResourcePrinterPass(dbgs()))
21
+ #undef MODULE_PASS
Original file line number Diff line number Diff line change @@ -104,19 +104,8 @@ DirectXTargetMachine::~DirectXTargetMachine() {}
104
104
105
105
void DirectXTargetMachine::registerPassBuilderCallbacks (
106
106
PassBuilder &PB, bool PopulateClassToPassNames) {
107
- PB.registerPipelineParsingCallback (
108
- [](StringRef PassName, ModulePassManager &PM,
109
- ArrayRef<PassBuilder::PipelineElement>) {
110
- if (PassName == " print-dxil-resource" ) {
111
- PM.addPass (DXILResourcePrinterPass (dbgs ()));
112
- return true ;
113
- }
114
- if (PassName == " print-dx-shader-flags" ) {
115
- PM.addPass (dxil::ShaderFlagsAnalysisPrinter (dbgs ()));
116
- return true ;
117
- }
118
- return false ;
119
- });
107
+ #define GET_PASS_REGISTRY " DirectXPassRegistry.def"
108
+ #include " llvm/Passes/TargetPassRegistry.inc"
120
109
121
110
PB.registerAnalysisRegistrationCallback ([](ModuleAnalysisManager &MAM) {
122
111
MAM.registerPass ([&] { return DXILResourceAnalysis (); });
You can’t perform that action at this time.
0 commit comments