LLVM 19.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 LLVMTargetMachine;
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 LLVMTargetMachine *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
46};
47
48} // namespace llvm
49
50#endif // LLVM_CODEGEN_MachineFunctionAnalysis
#define F(x, y, z)
Definition: MD5.cpp:55
FunctionAnalysisManager FAM
const char LLVMTargetMachineRef TM
This header defines various interfaces for pass management in LLVM.
API to communicate dependencies between analyses during invalidation.
Definition: PassManager.h:360
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:321
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Result(std::unique_ptr< MachineFunction > MF)
bool invalidate(Function &, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
This analysis create MachineFunction for given Function.
MachineFunctionAnalysis(const LLVMTargetMachine *TM)
Result run(Function &F, FunctionAnalysisManager &FAM)
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
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:1849
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:97
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: Analysis.h:26