Path: blob/main/contrib/llvm-project/llvm/lib/Target/DirectX/DXILResourceAnalysis.h
35294 views
//===- DXILResourceAnalysis.h - DXIL Resource analysis-------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7///8/// \file This file contains Analysis for information about DXIL resources.9///10//===----------------------------------------------------------------------===//1112#ifndef LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H13#define LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H1415#include "DXILResource.h"16#include "llvm/IR/PassManager.h"17#include "llvm/Pass.h"18#include <memory>1920namespace llvm {21/// Analysis pass that exposes the \c DXILResource for a module.22class DXILResourceAnalysis : public AnalysisInfoMixin<DXILResourceAnalysis> {23friend AnalysisInfoMixin<DXILResourceAnalysis>;24static AnalysisKey Key;2526public:27typedef dxil::Resources Result;28dxil::Resources run(Module &M, ModuleAnalysisManager &AM);29};3031/// Printer pass for the \c DXILResourceAnalysis results.32class DXILResourcePrinterPass : public PassInfoMixin<DXILResourcePrinterPass> {33raw_ostream &OS;3435public:36explicit DXILResourcePrinterPass(raw_ostream &OS) : OS(OS) {}37PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);38static bool isRequired() { return true; }39};4041/// The legacy pass manager's analysis pass to compute DXIL resource42/// information.43class DXILResourceWrapper : public ModulePass {44dxil::Resources Resources;4546public:47static char ID; // Pass identification, replacement for typeid4849DXILResourceWrapper();5051dxil::Resources &getDXILResource() { return Resources; }52const dxil::Resources &getDXILResource() const { return Resources; }5354/// Calculate the DXILResource for the module.55bool runOnModule(Module &M) override;5657void print(raw_ostream &O, const Module *M = nullptr) const override;58};59} // namespace llvm6061#endif // LLVM_TARGET_DIRECTX_DXILRESOURCEANALYSIS_H626364