1//===-- MachineFunctionPass.h - Pass for MachineFunctions --------*-C++ -*-===//
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
7//===----------------------------------------------------------------------===//
9// This file defines the MachineFunctionPass class. MachineFunctionPass's are
10// just FunctionPass's, except they operate on machine code as part of a code
11// generator. Because they operate on machine code, not the LLVM
12// representation, MachineFunctionPass's are not allowed to modify the LLVM
13// representation. Due to this limitation, the MachineFunctionPass class takes
14// care of declaring that no LLVM passes are invalidated.
16//===----------------------------------------------------------------------===//
18#ifndef LLVM_CODEGEN_MACHINEFUNCTIONPASS_H
19#define LLVM_CODEGEN_MACHINEFUNCTIONPASS_H
27/// MachineFunctionPass - This class adapts the FunctionPass interface to
28/// allow convenient creation of passes that operate on the MachineFunction
29/// representation. Instead of overriding runOnFunction, subclasses
30/// override runOnMachineFunction.
34 // Cache the properties info at module-init time so we don't have to
35 // construct them for every function.
44 /// runOnMachineFunction - This method must be overloaded to perform the
45 /// desired machine code transformation or analysis.
49 /// getAnalysisUsage - Subclasses that override getAnalysisUsage
52 /// For MachineFunctionPasses, calling AU.preservesCFG() indicates that
53 /// the pass does not modify the MachineBasicBlock CFG.
72 /// createPrinterPass - Get a machine function printer pass.
74 const std::string &Banner)
const override;
79}
// End llvm namespace
static bool runOnFunction(Function &F, bool PostInlining)
Represent the analysis usage information of a pass.
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
virtual MachineFunctionProperties getClearedProperties() const
MachineFunctionPass(char &ID)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual MachineFunctionProperties getSetProperties() const
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
virtual MachineFunctionProperties getRequiredProperties() const
Properties which a MachineFunction may have at a given point in time.
A Module instance is used to store all the information related to an LLVM module.
Pass interface - Implemented by all 'passes'.
This class implements an extremely fast bulk output stream that can only output to a stream.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.