LLVM 23.0.0git
AsmPrinterAnalysis.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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// Holds an AsmPrinter instance so that state can be shared appropriately
10// between the Module and MachineFunction portions of AsmPrinter.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CODEGEN_ASMPRINTERANALYSIS_H
15#define LLVM_CODEGEN_ASMPRINTERANALYSIS_H
16
18#include "llvm/IR/Analysis.h"
19#include "llvm/IR/PassManager.h"
20
21namespace llvm {
22
23class AsmPrinterAnalysis : public AnalysisInfoMixin<AsmPrinterAnalysis> {
24public:
26 std::unique_ptr<AsmPrinter> HeldPrinter;
27
28 class Result {
29 AsmPrinter &Printer;
30 Result(AsmPrinter &Printer) : Printer(Printer) {}
31 friend class AsmPrinterAnalysis;
32
33 public:
34 AsmPrinter &getPrinter() { return Printer; }
35
37 ModuleAnalysisManager::Invalidator &) {
38 return false;
39 }
40 };
41
45
46public:
47 AsmPrinterAnalysis(std::unique_ptr<AsmPrinter> Printer)
49};
50
51} // namespace llvm
52
53#endif // LLVM_CODEGEN_ASMPRINTERANALYSIS_H
dxil pretty DXIL Metadata Pretty Printer
This header defines various interfaces for pass management in LLVM.
bool invalidate(Module &, const PreservedAnalyses, ModuleAnalysisManager::Invalidator &)
Result run(Module &M, ModuleAnalysisManager &)
std::unique_ptr< AsmPrinter > HeldPrinter
AsmPrinterAnalysis(std::unique_ptr< AsmPrinter > Printer)
This class is intended to be used as a driving class for all asm writers.
Definition AsmPrinter.h:91
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1917
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:870
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition PassManager.h:93
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29