1 //===- DXILResourceAnalysis.cpp - DXIL Resource analysis-------------------===//
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
7 //===----------------------------------------------------------------------===//
9 /// \file This file contains Analysis for information about DXIL resources.
11 //===----------------------------------------------------------------------===//
13 #include "DXILResourceAnalysis.h"
15 #include "llvm/IR/PassManager.h"
19 #define DEBUG_TYPE "dxil-resource-analysis"
21 dxil::Resources
DXILResourceAnalysis::run(Module
&M
,
22 ModuleAnalysisManager
&AM
) {
28 AnalysisKey
DXILResourceAnalysis::Key
;
30 PreservedAnalyses
DXILResourcePrinterPass::run(Module
&M
,
31 ModuleAnalysisManager
&AM
) {
32 dxil::Resources Res
= AM
.getResult
<DXILResourceAnalysis
>(M
);
34 return PreservedAnalyses::all();
37 char DXILResourceWrapper::ID
= 0;
38 INITIALIZE_PASS_BEGIN(DXILResourceWrapper
, DEBUG_TYPE
,
39 "DXIL resource Information", true, true)
40 INITIALIZE_PASS_END(DXILResourceWrapper
, DEBUG_TYPE
,
41 "DXIL resource Information", true, true)
43 bool DXILResourceWrapper::runOnModule(Module
&M
) {
48 DXILResourceWrapper::DXILResourceWrapper() : ModulePass(ID
) {}
50 void DXILResourceWrapper::print(raw_ostream
&OS
, const Module
*) const {