Go to the documentation of this file.
17 #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
18 #define LLVM_CODEGEN_MACHINEFUNCTION_H
51 class DILocalVariable;
54 class GISelChangeObserver;
56 class LLVMTargetMachine;
57 class MachineConstantPool;
58 class MachineFrameInfo;
59 class MachineFunction;
60 class MachineJumpTableInfo;
61 class MachineModuleInfo;
62 class MachineRegisterInfo;
68 class PseudoSourceValueManager;
72 class TargetRegisterClass;
73 class TargetSubtargetInfo;
74 struct WasmEHFuncInfo;
85 template <
class Iterator>
87 assert(
this == &OldList &&
"never transfer MBBs between functions");
102 template<
typename Ty>
104 return new (
Allocator.Allocate<Ty>()) Ty(MF);
163 return Properties[
static_cast<unsigned>(
P)];
167 Properties.
set(
static_cast<unsigned>(
P));
172 Properties.
reset(
static_cast<unsigned>(
P));
183 Properties |= MFP.Properties;
188 Properties.
reset(MFP.Properties);
195 return !V.Properties.
test(Properties);
264 std::vector<MachineBasicBlock*> MBBNumbering;
270 std::vector<char> BBSectionsSymbolPrefix;
291 unsigned FunctionNumber;
301 bool ExposesReturnsTwice =
false;
304 bool HasInlineAsm =
false;
307 bool HasWinCFI =
false;
314 std::unique_ptr<PseudoSourceValueManager> PSVManager;
318 std::vector<MCCFIInstruction> FrameInstructions;
322 std::vector<MCSymbol *> LongjmpTargets;
326 std::vector<MCSymbol *> CatchretTargets;
332 std::vector<LandingPadInfo> LandingPads;
344 std::vector<std::pair<MCSymbol *, MDNode *>> CodeViewAnnotations;
346 bool CallsEHReturn =
false;
347 bool CallsUnwindInit =
false;
348 bool HasEHCatchret =
false;
349 bool HasEHScopes =
false;
350 bool HasEHFunclets =
false;
356 std::vector<const GlobalValue *> TypeInfos;
359 std::vector<unsigned> FilterIds;
362 std::vector<unsigned> FilterEnds;
393 virtual void anchor();
411 assert(
Arg < (1 << 16) &&
"Arg out of range");
454 std::map<DebugInstrOperandPair, DebugInstrOperandPair>
470 unsigned MaxOperand = UINT_MAX);
487 assert(TheDelegate == delegate &&
488 "Only the current delegate can perform reset!");
489 TheDelegate =
nullptr;
495 assert(delegate && !TheDelegate &&
496 "Attempted to set delegate to null, or to change it without "
497 "first resetting it!");
499 TheDelegate = delegate;
561 return *
static_cast<const STC *
>(STI);
618 return ExposesReturnsTwice;
624 ExposesReturnsTwice =
B;
652 template<
typename Ty>
655 MFInfo = Ty::template create<Ty>(
Allocator, *
this);
656 return static_cast<Ty*
>(MFInfo);
659 template<
typename Ty>
673 assert(
N < MBBNumbering.size() &&
"Illegal block number");
674 assert(MBBNumbering[
N] &&
"Block was removed from the machine function!");
675 return MBBNumbering[
N];
715 bool verify(
Pass *
p =
nullptr,
const char *Banner =
nullptr,
716 bool AbortOnError =
true)
const;
727 return &MachineFunction::BasicBlocks;
747 unsigned size()
const {
return (
unsigned)BasicBlocks.size();}
748 bool empty()
const {
return BasicBlocks.empty(); }
760 BasicBlocks.
splice(InsertPt, BasicBlocks,
MBBI);
763 BasicBlocks.
splice(InsertPt, BasicBlocks,
MBB);
766 BasicBlocks.
splice(InsertPt, BasicBlocks,
MBBI, MBBE);
774 template <
typename Comp>
776 BasicBlocks.sort(comp);
793 MBBNumbering.push_back(
MBB);
794 return (
unsigned)MBBNumbering.size()-1;
801 assert(
N < MBBNumbering.size() &&
"Illegal basic block #");
802 MBBNumbering[
N] =
nullptr;
808 bool NoImplicit =
false);
900 MCSymbol *PostInstrSymbol =
nullptr,
MDNode *HeapAllocMarker =
nullptr);
912 bool isLinkerPrivate =
false)
const;
922 return FrameInstructions;
931 return LongjmpTargets;
941 return CatchretTargets;
947 CatchretTargets.push_back(
Target);
973 bool TidyIfNoBeginLabels =
true);
1018 WasmLPadToIndexMap[LPad] =
Index;
1023 return WasmLPadToIndexMap.
count(LPad);
1029 return WasmLPadToIndexMap.
lookup(LPad);
1035 "missing call site number for landing pad!");
1036 return LPadToCallSiteMap[Sym];
1041 return !LPadToCallSiteMap[Sym].
empty();
1046 CallSiteMap[BeginLabel] = Site;
1052 "Missing call site number for EH_LABEL!");
1053 return CallSiteMap.
lookup(BeginLabel);
1058 return CallSiteMap.
count(BeginLabel);
1063 CodeViewAnnotations.push_back({Label, MD});
1067 return CodeViewAnnotations;
1101 assert(Inserted &&
"Call site info not unique");
1105 return CallSitesInfo;
1121 return BBSectionsSymbolPrefix;
1189 return &
G.Graph->front();
1195 return &
G.Graph->front();
1199 class MachineFunctionAnalysisManager;
1201 const std::string &Banner,
1202 const MachineFunction &MF);
1206 #endif // LLVM_CODEGEN_MACHINEFUNCTION_H
void remove(iterator MBBI)
bool hasInlineAsm() const
Returns true if the function contains any inline assembly.
bool hasProperty(Property P) const
void resetDelegate(Delegate *delegate)
Reset the currently registered delegate - otherwise assert.
const Ty * getInfo() const
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MachineFunctionProperties & getProperties()
print lazy value Lazy Value Info Printer Pass
T * allocate(Capacity Cap, AllocatorType &Allocator)
Allocate an array of at least the requested capacity.
A parsed version of the target data layout string in and methods for querying it.
VariableDbgInfoMapTy & getVariableDbgInfo()
std::pair< unsigned, unsigned > DebugInstrOperandPair
Pair of instruction number and operand number.
const std::vector< char > & getBBSectionsSymbolPrefix() const
uint32_t * allocateRegMask()
Allocate and initialize a register mask with NumRegister bits.
void print(raw_ostream &OS) const
Print the MachineFunctionProperties in human-readable form.
void push_back(pointer val)
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Context object for machine code objects.
MCContext & getContext() const
VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
const STC & getSubtarget() const
getSubtarget - This method returns a pointer to the specified type of TargetSubtargetInfo.
void assignBeginEndSections()
Assign IsBeginSection IsEndSection fields for basic blocks in this function.
Target - Wrapper for Target specific information.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
GISelChangeObserver * getObserver() const
MCSymbol * LandingPadLabel
void splice(iterator InsertPt, MachineBasicBlock *MBB)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, uint64_t s, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
void copyCallSiteInfo(const MachineInstr *Old, const MachineInstr *New)
Copy the call site info from Old to \ New.
SmallVector< SEHHandler, 1 > SEHHandlers
bool exposesReturnsTwice() const
exposesReturnsTwice - Returns true if the function calls setjmp or any other similar functions with a...
MachineJumpTableInfo * getOrCreateJumpTableInfo(unsigned JTEntryKind)
getOrCreateJumpTableInfo - Get the JumpTableInfo for this function, if it does already exist,...
unsigned getFunctionNumber() const
getFunctionNumber - Return a unique ID for the current function.
void setCallsUnwindInit(bool b)
const MachineBasicBlock & back() const
base_list_type::const_reverse_iterator const_reverse_iterator
Callbacks do nothing by default in iplist and ilist.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
void ensureAlignment(Align A)
ensureAlignment - Make sure the function is at least A bytes aligned.
void moveCallSiteInfo(const MachineInstr *Old, const MachineInstr *New)
Move the call site info from Old to \New call site info.
static unsigned InstrCount
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
void push_front(MachineBasicBlock *MBB)
virtual void MF_HandleRemoval(MachineInstr &MI)=0
Callback before a removal. This should not modify the MI directly.
unsigned getInstructionCount() const
Return the number of MachineInstrs in this MachineFunction.
unsigned getNewDebugInstrNum()
A description of a memory reference used in the backend.
void insert(iterator MBBI, MachineBasicBlock *MBB)
PseudoSourceValueManager & getPSVManager() const
void setCallSiteLandingPad(MCSymbol *Sym, ArrayRef< unsigned > Sites)
Map the landing pad's EH symbol to the call site indexes.
Properties which a MachineFunction may have at a given point in time.
size_type count(const_arg_type_t< KeyT > Val) const
Return 1 if the specified key is in the map, 0 otherwise.
void setDelegate(Delegate *delegate)
Set the delegate.
bool callsUnwindInit() const
void addCodeViewAnnotation(MCSymbol *Label, MDNode *MD)
Record annotations associated with a particular label.
void addSEHCatchHandler(MachineBasicBlock *LandingPad, const Function *Filter, const BlockAddress *RecoverBA)
pointer remove(iterator &IT)
bool hasCallSiteLandingPad(MCSymbol *Sym)
Return true if the landing pad Eh symbol has an associated call site.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MCSymbol * getJTISymbol(unsigned JTI, MCContext &Ctx, bool isLinkerPrivate=false) const
getJTISymbol - Return the MCSymbol for the specified non-empty jump table.
void setHasEHFunclets(bool V)
static Ty * create(BumpPtrAllocator &Allocator, MachineFunction &MF)
Factory function: default behavior is to call new using the supplied allocator.
std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
the resulting code requires compare and branches when and if * p
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
void splice(iterator where, iplist_impl &L2)
const Function * FilterOrFinally
Filter or finally function. Null indicates a catch-all.
BasicBlockListType::iterator iterator
iterator erase(iterator where)
const std::vector< MCCFIInstruction > & getFrameInstructions() const
Returns a reference to a list of cfi instructions in the function's prologue.
LLVM Basic Block Representation.
static nodes_iterator nodes_end(MachineFunction *F)
void setExposesReturnsTwice(bool B)
setCallsSetJmp - Set a flag that indicates if there's a call to a "returns twice" function.
static void clear(coro::Shape &Shape)
void setWasmLandingPadIndex(const MachineBasicBlock *LPad, unsigned Index)
Map the landing pad to its index. Used for Wasm exception handling.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
void verifyMachineFunction(MachineFunctionAnalysisManager *, const std::string &Banner, const MachineFunction &MF)
static nodes_iterator nodes_begin(MachineFunction *F)
Structure used to represent pair of argument number after call lowering and register used to transfer...
void substituteDebugValuesForInst(const MachineInstr &Old, MachineInstr &New, unsigned MaxOperand=UINT_MAX)
Create substitutions for any tracked values in Old, to point at New.
static nodes_iterator nodes_end(const MachineFunction *F)
< i1 > br i1 label label bb bb
const MachineBasicBlock & front() const
ArgRegPair(Register R, unsigned Arg)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
void setSection(MCSection *S)
Indicates the Section this function belongs to.
SmallVector< MCSymbol *, 1 > EndLabels
void push_front(pointer val)
Itanium Name Demangler i e convert the string _Z1fv into f()". You can also use the CRTP base ManglingParser to perform some simple analysis on the mangled name
void setAlignment(Align A)
setAlignment - Set the alignment of the function.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const std::vector< unsigned > & getFilterIds() const
Return a reference to the typeids encoding filters used in the current function.
DenormalMode getDenormalMode(const fltSemantics &FPType) const
Returns the denormal handling type for the default rounding mode of the function.
@ System
Synchronized with respect to all concurrently executing threads.
void addCatchTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
Provide the catch typeinfo for a landing pad.
bool verifyRequiredProperties(const MachineFunctionProperties &V) const
static unsigned size(const MachineFunction *F)
void setObserver(GISelChangeObserver *O)
void DeleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
virtual ~MachineFunctionInfo()
SmallVectorImpl< unsigned > & getCallSiteLandingPad(MCSymbol *Sym)
Get the call site indexes for a landing pad EH symbol.
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int b
bool hasBBLabels() const
Returns true if basic block labels are to be generated for this function.
const MachineFunctionProperties & getProperties() const
Get the function properties.
void deallocate(Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.
std::vector< int > TypeIds
void setDebugInstrNumberingCount(unsigned Num)
Set value of DebugInstrNumberingCount field.
unsigned getTypeIDFor(const GlobalValue *TI)
Return the type id for the specified typeinfo. This is function wide.
Describe properties that are true of each instruction in the target description file.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MachineOperand class - Representation of each machine instruction operand.
reverse_iterator rbegin()
MachineFunctionProperties & set(Property P)
const VariableDbgInfoMapTy & getVariableDbgInfo() const
bool hasEHCatchret() const
This class contains meta information specific to a module.
void transferNodesFromList(ilist_callback_traits &OldList, Iterator, Iterator)
static NodeRef getEntryNode(Inverse< const MachineFunction * > G)
void viewCFG() const
viewCFG - This function is meant for use from the debugger.
This class implements an extremely fast bulk output stream that can only output to a stream.
void makeDebugValueSubstitution(DebugInstrOperandPair, DebugInstrOperandPair)
Create a substitution between one <instr,operand> value to a different, new value.
bool shouldSplitStack() const
Should we be emitting segmented stack stuff for the function.
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering.
void setHasWinCFI(bool v)
void addFilterTypeInfo(MachineBasicBlock *LandingPad, ArrayRef< const GlobalValue * > TyInfo)
Provide the filter typeinfo for a landing pad.
bool verify(Pass *p=nullptr, const char *Banner=nullptr, bool AbortOnError=true) const
Run the current MachineFunction through the machine code verifier, useful for debugger use.
const WasmEHFuncInfo * getWasmEHFuncInfo() const
getWasmEHFuncInfo - Return information about how the current function uses Wasm exception handling.
void removeFromMBBNumbering(unsigned N)
removeFromMBBNumbering - Remove the specific machine basic block from our tracker,...
This struct is a compact representation of a valid (non-zero power of two) alignment.
void tidyLandingPads(DenseMap< MCSymbol *, uintptr_t > *LPMap=nullptr, bool TidyIfNoBeginLabels=true)
Remap landing pad labels and remove any deleted landing pads.
void addInvoke(MachineBasicBlock *LandingPad, MCSymbol *BeginLabel, MCSymbol *EndLabel)
Provide the begin and end labels of an invoke style call and associate it with a try landing pad bloc...
base_list_type::reverse_iterator reverse_iterator
MachineFunctionProperties & reset(const MachineFunctionProperties &MFP)
static NodeRef getEntryNode(MachineFunction *F)
void viewCFGOnly() const
viewCFGOnly - This function is meant for use from the debugger.
const MachineConstantPool * getConstantPool() const
const DIExpression * Expr
Template traits for intrusive list.
MachineFunctionProperties & set(const MachineFunctionProperties &MFP)
MachineModuleInfo & getMMI() const
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
Dellocate an array of MachineOperands and recycle the memory.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
AtomicOrdering
Atomic ordering for LLVM's memory model.
void setHasInlineAsm(bool B)
Set a flag that indicates that the function contains inline assembly.
const_reverse_iterator rend() const
void push_back(MachineBasicBlock *MBB)
void setCallSiteBeginLabel(MCSymbol *BeginLabel, unsigned Site)
Map the begin label for a call site.
void addCallArgsForwardingRegs(const MachineInstr *CallI, CallSiteInfoImpl &&CallInfo)
Start tracking the arguments passed to the call CallI.
SmallVector< MCSymbol *, 1 > BeginLabels
Representation of each machine instruction.
MachineFunctionProperties & reset()
Reset all the properties.
bool callsEHReturn() const
MachineInstr::ExtraInfo * createMIExtraInfo(ArrayRef< MachineMemOperand * > MMOs, MCSymbol *PreInstrSymbol=nullptr, MCSymbol *PostInstrSymbol=nullptr, MDNode *HeapAllocMarker=nullptr)
Allocate and construct an extra info structure for a MachineInstr.
MachineBasicBlock & front()
void setHasEHCatchret(bool V)
void addSEHCleanupHandler(MachineBasicBlock *LandingPad, const Function *Cleanup)
MachineInstr * CloneMachineInstr(const MachineInstr *Orig)
Create a new MachineInstr which is a copy of Orig, identical in all ways except the instruction has n...
base_list_type::iterator iterator
MachineBasicBlock & back()
multiplies can be turned into SHL s
void splice(iterator InsertPt, iterator MBBI)
Allocate memory in an ever growing pool, as if by bump-pointer.
This class contains a discriminated union of information about pointers in memory operands,...
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
The MachineConstantPool class keeps track of constants referenced by a function which must be spilled...
void dump() const
dump - Print the current MachineFunction to cerr, useful for debugger use.
const CallSiteInfoMap & getCallSitesInfo() const
static NodeRef getEntryNode(const MachineFunction *F)
Represent subnormal handling kind for floating point instruction inputs and outputs.
initializer< Ty > init(const Ty &Val)
Use delete by default for iplist and ilist.
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=nullptr)
CreateMachineBasicBlock - Allocate a new MachineBasicBlock.
Flags
Flags values. These may be or'd together.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
MachineBasicBlock * LandingPadBlock
ArrayRef< std::pair< MCSymbol *, MDNode * > > getCodeViewAnnotations() const
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const std::vector< LandingPadInfo > & getLandingPads() const
Return a reference to the landing pad info for the current function.
void erase(iterator MBBI)
@ BasicBlock
Various leaf nodes.
Recycler - This class manages a linked-list of deallocated nodes and facilitates reusing deallocated ...
std::map< DebugInstrOperandPair, DebugInstrOperandPair > DebugValueSubstitutions
Substitution map: from one <inst,operand> pair to another.
const_iterator begin() const
Register addLiveIn(MCRegister PReg, const TargetRegisterClass *RC)
addLiveIn - Add the specified physical register as a live-in value and create a corresponding virtual...
WasmEHFuncInfo * getWasmEHFuncInfo()
MIPS Relocation Principles In there are several elements of the llvm::ISD::NodeType enum that deal with addresses and or relocations These are defined in include llvm Target TargetSelectionDAG td ConstantPool
The address of a basic block.
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
static nodes_iterator nodes_begin(const MachineFunction *F)
const_reverse_iterator rbegin() const
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
void DeleteMachineBasicBlock(MachineBasicBlock *MBB)
DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
ArrayRef< int > allocateShuffleMask(ArrayRef< int > Mask)
void setHasEHScopes(bool V)
StringRef - Represent a constant reference to a string, i.e.
MachineBasicBlock MachineBasicBlock::iterator MBBI
void addNodeToList(NodeTy *)
When an MBB is added to an MF, we need to update the parent pointer of the MBB, the MBB numbering,...
static unsigned size(MachineFunction *F)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Instances of this class represent a uniqued identifier for a section in the current translation unit.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
bool hasBBSections() const
Returns true if this function has basic block sections enabled.
MachineFunctionProperties & reset(Property P)
Abstract class that contains various methods for clients to notify about changes.
TargetSubtargetInfo - Generic base class for all target subtargets.
unsigned DebugInstrNumberingCount
A count of how many instructions in the function have had numbers assigned to them.
MachineInstr & CloneMachineInstrBundle(MachineBasicBlock &MBB, MachineBasicBlock::iterator InsertBefore, const MachineInstr &Orig)
Clones instruction or the whole instruction bundle Orig and insert into MBB before InsertBefore.
Wrapper class representing virtual and physical registers.
static NodeRef getEntryNode(Inverse< MachineFunction * > G)
LLVM_NODISCARD bool empty() const
MCSection * getSection() const
Returns the Section this function belongs to.
int getFilterIDFor(std::vector< unsigned > &TyIds)
Return the id of the filter encoded by TyIds. This is function wide.
const_iterator end() const
const MachineFrameInfo & getFrameInfo() const
MachineBasicBlock * getBlockNumbered(unsigned N) const
getBlockNumbered - MachineBasicBlocks are automatically numbered when they are inserted into the mach...
bool test(unsigned Idx) const
Function & getFunction()
Return the LLVM function that this machine code represents.
bool needsFrameMoves() const
True if this function needs frame moves for debug or exceptions.
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Iterator for intrusive lists based on ilist_node.
void erase(MachineBasicBlock *MBBI)
const WinEHFuncInfo * getWinEHFuncInfo() const
getWinEHFuncInfo - Return information about how the current function uses Windows exception handling.
void addCatchretTarget(MCSymbol *Target)
Add the specified symbol to the list of valid catchret targets for Windows EHCont Guard.
MachineOperand * allocateOperandArray(OperandCapacity Cap)
Allocate an array of MachineOperands.
void print(raw_ostream &OS, const SlotIndexes *=nullptr) const
print - Print out the MachineFunction in a format suitable for debugging to the specified stream.
bool hasCallSiteBeginLabel(MCSymbol *BeginLabel) const
Return true if the begin label has a call site number associated with it.
void removeNodeFromList(NodeTy *)
#define LLVM_NODISCARD
LLVM_NODISCARD - Warn if a type or return value is discarded.
WinEHFuncInfo * getWinEHFuncInfo()
This class describes a target machine that is implemented with the LLVM target-independent code gener...
bool isCandidateForCallSiteEntry(QueryType Type=IgnoreBundle) const
Return true if this is a call instruction that may have an associated call site entry in the debug in...
MachineFunction(Function &F, const LLVMTargetMachine &Target, const TargetSubtargetInfo &STI, unsigned FunctionNum, MachineModuleInfo &MMI)
bool hasEHFunclets() const
void addCleanup(MachineBasicBlock *LandingPad)
Add a cleanup action for a landing pad.
void addLongjmpTarget(MCSymbol *Target)
Add the specified symbol to the list of valid longjmp targets for Windows Control Flow Guard.
iterator insert(iterator where, pointer New)
MCSymbol * getPICBaseSymbol() const
getPICBaseSymbol - Return a function-local symbol to represent the PIC base.
LLVM_NODISCARD unsigned addFrameInst(const MCCFIInstruction &Inst)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Pass interface - Implemented by all 'passes'.
bool hasWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Returns true if the landing pad has an associate index in wasm EH.
void reset()
Reset the instance as if it was just created.
Manages creation of pseudo source values.
static void deleteNode(NodeTy *V)
base_list_type::const_iterator const_iterator
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&... Args)
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
unsigned getCallSiteBeginLabel(MCSymbol *BeginLabel) const
Get the call site number for a begin label.
This structure is used to retain landing pad info for the current function.
static BasicBlockListType MachineFunction::* getSublistAccess(MachineBasicBlock *)
Support for MachineBasicBlock::getNextNode().
void remove(MachineBasicBlock *MBBI)
const DILocalVariable * Var
const std::vector< const GlobalValue * > & getTypeInfos() const
Return a reference to the C++ typeinfo for the current function.
const char * createExternalSymbolName(StringRef Name)
Allocate a string and populate it with the given external symbol name.
const std::vector< MCSymbol * > & getCatchretTargets() const
Returns a reference to a list of symbols that we have catchrets.
unsigned getWasmLandingPadIndex(const MachineBasicBlock *LPad) const
Get the index in wasm EH for a given landing pad.
const MachineJumpTableInfo * getJumpTableInfo() const
getJumpTableInfo - Return the jump table info object for the current function.
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, const DebugLoc &DL, bool NoImplicit=false)
CreateMachineInstr - Allocate a new MachineInstr.
MCSymbol * addLandingPad(MachineBasicBlock *LandingPad)
Add a new panding pad, and extract the exception handling information from the landingpad instruction...
MachineFunction & operator=(const MachineFunction &)=delete
void eraseCallSiteInfo(const MachineInstr *MI)
Following functions update call site info.
MachineJumpTableInfo * getJumpTableInfo()
VariableDbgInfoMapTy VariableDbgInfos
Align getAlignment() const
getAlignment - Return the alignment of the function.
void setBBSectionsType(BasicBlockSection V)
MachineFunctionInfo - This class can be derived from and used by targets to hold private target-speci...
const BlockAddress * RecoverBA
Address of block to recover at. Null for a finally handler.
virtual ~Delegate()=default
void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, int Slot, const DILocation *Loc)
Collect information used to emit debugging information of a variable.
LandingPadInfo(MachineBasicBlock *MBB)
void RenumberBlocks(MachineBasicBlock *MBBFrom=nullptr)
RenumberBlocks - This discards all of the MachineBasicBlock numbers and recomputes them.
void setCallsEHReturn(bool b)
LandingPadInfo & getOrCreateLandingPadInfo(MachineBasicBlock *LandingPad)
Find or create an LandingPadInfo for the specified MachineBasicBlock.
const MachineRegisterInfo & getRegInfo() const
const std::vector< MCSymbol * > & getLongjmpTargets() const
Returns a reference to a list of symbols immediately following calls to _setjmp in the function.
reference emplace_back(ArgTypes &&... Args)
Wrapper class representing physical registers. Should be passed by value.
virtual void MF_HandleInsertion(MachineInstr &MI)=0
Callback after an insertion. This should not modify the MI directly.