LLVM 20.0.0git
DXILMetadataAnalysis.h
Go to the documentation of this file.
1//=- DXILMetadataAnalysis.h - Representation of Module metadata --*- 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#ifndef LLVM_ANALYSIS_DXILMETADATA_H
10#define LLVM_ANALYSIS_DXILMETADATA_H
11
12#include "llvm/IR/PassManager.h"
13#include "llvm/IR/Value.h"
14#include "llvm/Pass.h"
17#include <memory>
18
19namespace llvm {
20
21namespace dxil {
22
27
28 void print(raw_ostream &OS) const;
29};
30
31} // namespace dxil
32
33// Module metadata analysis pass for new pass manager
34class DXILMetadataAnalysis : public AnalysisInfoMixin<DXILMetadataAnalysis> {
36
37 static AnalysisKey Key;
38
39public:
41 /// Gather module metadata info for the module \c M.
43};
44
45/// Printer pass for the \c DXILMetadataAnalysis results.
47 : public PassInfoMixin<DXILMetadataAnalysisPrinterPass> {
48 raw_ostream &OS;
49
50public:
52
54
55 static bool isRequired() { return true; }
56};
57
58/// Legacy pass
60 std::unique_ptr<dxil::ModuleMetadataInfo> MetadataInfo;
61
62public:
63 static char ID; // Class identification, replacement for typeinfo
64
67
69 return *MetadataInfo;
70 }
71 dxil::ModuleMetadataInfo &getModuleMetadata() { return *MetadataInfo; }
72
73 void getAnalysisUsage(AnalysisUsage &AU) const override;
74 bool runOnModule(Module &M) override;
75 void releaseMemory() override;
76
77 void print(raw_ostream &OS, const Module *M) const override;
78 void dump() const;
79};
80
81} // namespace llvm
82
83#endif // LLVM_ANALYSIS_DXILMETADATA_H
This header defines various interfaces for pass management in LLVM.
raw_pwrite_stream & OS
Defines the llvm::VersionTuple class, which represents a version in the form major[....
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Represent the analysis usage information of a pass.
Printer pass for the DXILMetadataAnalysis results.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
dxil::ModuleMetadataInfo & getModuleMetadata()
const dxil::ModuleMetadataInfo & getModuleMetadata() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
bool runOnModule(Module &M) override
runOnModule - Virtual method overriden by subclasses to process the module being operated on.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void print(raw_ostream &OS, const Module *M) const override
print - Print out the internal state of the pass.
dxil::ModuleMetadataInfo run(Module &M, ModuleAnalysisManager &AM)
Gather module metadata info for the module M.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition: Pass.h:251
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
@ UnknownEnvironment
Definition: Triple.h:243
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:29
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition: PassManager.h:92
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:28
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69
Triple::EnvironmentType ShaderStage
void print(raw_ostream &OS) const