15 #ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
16 #define LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
24 class SelectionDAGBuilder;
49 if (!Locations.count(val))
51 return Locations[val];
54 assert(!Locations.count(val) &&
55 "Trying to allocate already allocated location");
56 Locations[val] = Location;
63 PendingGCRelocateCalls.push_back(&RelocCall);
70 std::find(PendingGCRelocateCalls.begin(), PendingGCRelocateCalls.end(),
72 assert(itr != PendingGCRelocateCalls.end() &&
73 "Visited unexpected gcrelocate call");
74 PendingGCRelocateCalls.erase(itr);
85 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
87 assert(!AllocatedStackSlots[Offset] &&
"already reserved!");
88 assert(NextSlotToAllocate <= (
unsigned)Offset &&
"consistency!");
89 AllocatedStackSlots[Offset] =
true;
92 assert(Offset >= 0 && Offset < (
int)AllocatedStackSlots.
size() &&
94 return AllocatedStackSlots[Offset];
109 unsigned NextSlotToAllocate;
116 #endif // LLVM_LIB_CODEGEN_SELECTIONDAG_STATEPOINTLOWERING_H
PointerUnion< const Value *, const PseudoSourceValue * > ValueType
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameter...
CallInst - This class represents a function call, abstracting a target machine's calling convention...
StatepointLoweringState()
void reserveStackSlot(int Offset)
bool isStackSlotAllocated(int Offset)
SDValue allocateStackSlot(EVT ValueType, SelectionDAGBuilder &Builder)
Get a stack slot we can use to store an value of type ValueType.
void clear()
Clear the memory usage of this object.
This class tracks both per-statepoint and per-selectiondag information.
EVT - Extended Value Type.
void setLocation(SDValue val, SDValue Location)
void startNewStatepoint(SelectionDAGBuilder &Builder)
Reset all state tracking for a newly encountered safepoint.
SDValue getLocation(SDValue val)
Returns the spill location of a value incoming to the current statepoint.
void scheduleRelocCall(const CallInst &RelocCall)
Record the fact that we expect to encounter a given gc_relocate before the next statepoint.
void relocCallVisited(const CallInst &RelocCall)
Remove this gc_relocate from the list we're expecting to see before the next statepoint.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...