xref: /llvm-project/llvm/lib/Target/DirectX/DXILResourceAnalysis.cpp (revision 81ee38551f2c9d1677471ab59bdc800e667b9616)
1 //===- DXILResourceAnalysis.cpp - DXIL Resource analysis-------------------===//
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 /// \file This file contains Analysis for information about DXIL resources.
10 ///
11 //===----------------------------------------------------------------------===//
12 
13 #include "DXILResourceAnalysis.h"
14 #include "DirectX.h"
15 #include "llvm/IR/PassManager.h"
16 
17 using namespace llvm;
18 
19 #define DEBUG_TYPE "dxil-resource-analysis"
20 
21 dxil::Resources DXILResourceMDAnalysis::run(Module &M,
22                                             ModuleAnalysisManager &AM) {
23   dxil::Resources R;
24   R.collect(M);
25   return R;
26 }
27 
28 AnalysisKey DXILResourceMDAnalysis::Key;
29 
30 char DXILResourceMDWrapper::ID = 0;
31 INITIALIZE_PASS_BEGIN(DXILResourceMDWrapper, DEBUG_TYPE,
32                       "DXIL resource Information", true, true)
33 INITIALIZE_PASS_END(DXILResourceMDWrapper, DEBUG_TYPE,
34                     "DXIL resource Information", true, true)
35 
36 bool DXILResourceMDWrapper::runOnModule(Module &M) {
37   Resources.collect(M);
38   return false;
39 }
40 
41 DXILResourceMDWrapper::DXILResourceMDWrapper() : ModulePass(ID) {}
42