30#ifndef LLVM_CODEGEN_MACHINEMODULEINFO_H
31#define LLVM_CODEGEN_MACHINEMODULEINFO_H
62 using SymbolListTy = std::vector<std::pair<MCSymbol *, StubValueTy>>;
98 const Module *TheModule =
nullptr;
108 unsigned NextFnNum = 0;
109 const Function *LastRequest =
nullptr;
136 return ExternalContext ? *ExternalContext : Context;
139 return ExternalContext ? *ExternalContext : Context;
160 if (FinalizedMFs.count(&F1) || FinalizedMFs.count(&F2))
162 MFDeletionGrouping.unionSets(&F1, &F2);
174 std::unique_ptr<MachineFunction> &&MF);
178 template<
typename Ty>
180 if (ObjFileMMI ==
nullptr)
181 ObjFileMMI =
new Ty(*
this);
182 return *
static_cast<Ty*
>(ObjFileMMI);
185 template<
typename Ty>
233 ModuleAnalysisManager::Invalidator &) {
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
Generic implementation of equivalence classes through the use Tarjan's efficient union-find algorithm...
This header defines various interfaces for pass management in LLVM.
This file defines the PointerIntPair class.
Implements a dense probed hash-table based set.
This represents a collection of equivalence classes and supports three efficient operations: insert a...
Context object for machine code objects.
friend class MachineModuleAnalysis
bool invalidate(Module &, const PreservedAnalyses &, ModuleAnalysisManager::Invalidator &)
MachineModuleInfo & getMMI()
LLVM_ABI Result run(Module &M, ModuleAnalysisManager &)
Run the analysis pass and produce machine module information.
MachineModuleAnalysis(MachineModuleInfo &MMI)
This class can be derived from and used by targets to hold private target-specific information for ea...
std::vector< std::pair< MCSymbol *, StubValueTy > > SymbolListTy
static SymbolListTy getSortedStubs(DenseMap< MCSymbol *, StubValueTy > &)
Return the entries from a DenseMap in a deterministic sorted orer.
std::vector< std::pair< MCSymbol *, const MCExpr * > > ExprStubListTy
A variant of SymbolListTy where the stub is a generalized MCExpr.
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
static ExprStubListTy getSortedExprStubs(DenseMap< MCSymbol *, const MCExpr * > &)
Return the entries from a DenseMap in a deterministic sorted orer.
virtual ~MachineModuleInfoImpl()
const MachineModuleInfo & getMMI() const
bool doFinalization(Module &) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
MachineModuleInfoWrapperPass(const TargetMachine *TM=nullptr)
MachineModuleInfo & getMMI()
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
This class contains meta information specific to a module.
LLVM_ABI MachineModuleInfo(const TargetMachine *TM=nullptr)
LLVM_ABI void initialize()
LLVM_ABI void insertFunction(const Function &F, std::unique_ptr< MachineFunction > &&MF)
Add an externally created MachineFunction MF for F.
friend class MachineModuleAnalysis
const Ty & getObjFileInfo() const
const MCContext & getContext() const
const Module * getModule() const
friend class MachineModuleInfoWrapperPass
LLVM_ABI MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
LLVM_ABI ~MachineModuleInfo()
Ty & getObjFileInfo()
Keep track of various per-module pieces of information for backends that would like to do so.
const TargetMachine & getTarget() const
LLVM_ABI MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
void groupMachineFunctionsForDeletion(const Function &F1, const Function &F2)
Group two IR functions so their MachineFunctions are deleted together once both functions have been f...
LLVM_ABI void deleteMachineFunctionFor(Function &F)
Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.
A Module instance is used to store all the information related to an LLVM module.
PointerIntPair - This class implements a pair of a pointer and small integer.
A set of analyses that are preserved following a run of a transformation pass.
Primary interface to the complete machine description for the target machine.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...