122018555SXiang Li //===- DXILResourceAnalysis.cpp - DXIL Resource analysis-------------------===// 222018555SXiang Li // 322018555SXiang Li // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 422018555SXiang Li // See https://llvm.org/LICENSE.txt for license information. 522018555SXiang Li // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 622018555SXiang Li // 722018555SXiang Li //===----------------------------------------------------------------------===// 822018555SXiang Li /// 922018555SXiang Li /// \file This file contains Analysis for information about DXIL resources. 1022018555SXiang Li /// 1122018555SXiang Li //===----------------------------------------------------------------------===// 1222018555SXiang Li 1322018555SXiang Li #include "DXILResourceAnalysis.h" 1422018555SXiang Li #include "DirectX.h" 1522018555SXiang Li #include "llvm/IR/PassManager.h" 1622018555SXiang Li 1722018555SXiang Li using namespace llvm; 1822018555SXiang Li 1922018555SXiang Li #define DEBUG_TYPE "dxil-resource-analysis" 2022018555SXiang Li 21*1c5f6cfcSJustin Bogner dxil::Resources DXILResourceMDAnalysis::run(Module &M, 2222018555SXiang Li ModuleAnalysisManager &AM) { 2322018555SXiang Li dxil::Resources R; 2422018555SXiang Li R.collect(M); 2522018555SXiang Li return R; 2622018555SXiang Li } 2722018555SXiang Li 28*1c5f6cfcSJustin Bogner AnalysisKey DXILResourceMDAnalysis::Key; 2922018555SXiang Li 30*1c5f6cfcSJustin Bogner char DXILResourceMDWrapper::ID = 0; 31*1c5f6cfcSJustin Bogner INITIALIZE_PASS_BEGIN(DXILResourceMDWrapper, DEBUG_TYPE, 3222018555SXiang Li "DXIL resource Information", true, true) 33*1c5f6cfcSJustin Bogner INITIALIZE_PASS_END(DXILResourceMDWrapper, DEBUG_TYPE, 3422018555SXiang Li "DXIL resource Information", true, true) 3522018555SXiang Li 36*1c5f6cfcSJustin Bogner bool DXILResourceMDWrapper::runOnModule(Module &M) { 3722018555SXiang Li Resources.collect(M); 3822018555SXiang Li return false; 3922018555SXiang Li } 4022018555SXiang Li 41*1c5f6cfcSJustin Bogner DXILResourceMDWrapper::DXILResourceMDWrapper() : ModulePass(ID) {} 42