LLVM 20.0.0git
MachineFunctionAnalysis.h
Go to the documentation of this file.
1//===- llvm/CodeGen/MachineFunctionAnalysis.h -------------------*- 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// This file declares the MachineFunctionAnalysis class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS
14#define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS
15
16#include "llvm/IR/PassManager.h"
17
18namespace llvm {
19
20class MachineFunction;
21class TargetMachine;
22
23/// This analysis create MachineFunction for given Function.
24/// To release the MachineFunction, users should invalidate it explicitly.
26 : public AnalysisInfoMixin<MachineFunctionAnalysis> {
28
29 static AnalysisKey Key;
30
31 const TargetMachine *TM;
32
33public:
34 class Result {
35 std::unique_ptr<MachineFunction> MF;
36
37 public:
38 Result(std::unique_ptr<MachineFunction> MF) : MF(std::move(MF)) {}
39 MachineFunction &getMF() { return *MF; };
40 bool invalidate(Function &, const PreservedAnalyses &PA,
42 };
43
44 MachineFunctionAnalysis(const TargetMachine *TM) : TM(TM) {};
46};
47
48} // namespace llvm
49
50#endif // LLVM_CODEGEN_MachineFunctionAnalysis
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
FunctionAnalysisManager FAM
API to communicate dependencies between analyses during invalidation.
Definition: PassManager.h:292
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
Result(std::unique_ptr< MachineFunction > MF)
bool invalidate(Function &, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
This analysis create MachineFunction for given Function.
Result run(Function &F, FunctionAnalysisManager &FAM)
MachineFunctionAnalysis(const TargetMachine *TM)
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
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:1873
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
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