forked from OSchip/llvm-project
[StatepointLowering] Minor NFC cleanups
- Use auto - Name variables in LLVM style - Use llvm::find instead of std::find - Blank lines between declarations llvm-svn: 264129
This commit is contained in:
parent
4cd746ebe0
commit
7edbef316b
|
@ -46,15 +46,16 @@ public:
|
|||
/// statepoint. Will return SDValue() if this value hasn't been
|
||||
/// spilled. Otherwise, the value has already been spilled and no
|
||||
/// further action is required by the caller.
|
||||
SDValue getLocation(SDValue val) {
|
||||
if (!Locations.count(val))
|
||||
SDValue getLocation(SDValue Val) {
|
||||
if (!Locations.count(Val))
|
||||
return SDValue();
|
||||
return Locations[val];
|
||||
return Locations[Val];
|
||||
}
|
||||
void setLocation(SDValue val, SDValue Location) {
|
||||
assert(!Locations.count(val) &&
|
||||
|
||||
void setLocation(SDValue Val, SDValue Location) {
|
||||
assert(!Locations.count(Val) &&
|
||||
"Trying to allocate already allocated location");
|
||||
Locations[val] = Location;
|
||||
Locations[Val] = Location;
|
||||
}
|
||||
|
||||
/// Record the fact that we expect to encounter a given gc_relocate
|
||||
|
@ -63,16 +64,15 @@ public:
|
|||
void scheduleRelocCall(const CallInst &RelocCall) {
|
||||
PendingGCRelocateCalls.push_back(&RelocCall);
|
||||
}
|
||||
|
||||
/// Remove this gc_relocate from the list we're expecting to see
|
||||
/// before the next statepoint. If we weren't expecting to see
|
||||
/// it, we'll report an assertion.
|
||||
void relocCallVisited(const CallInst &RelocCall) {
|
||||
SmallVectorImpl<const CallInst *>::iterator itr =
|
||||
std::find(PendingGCRelocateCalls.begin(), PendingGCRelocateCalls.end(),
|
||||
&RelocCall);
|
||||
assert(itr != PendingGCRelocateCalls.end() &&
|
||||
auto I = find(PendingGCRelocateCalls, &RelocCall);
|
||||
assert(I != PendingGCRelocateCalls.end() &&
|
||||
"Visited unexpected gcrelocate call");
|
||||
PendingGCRelocateCalls.erase(itr);
|
||||
PendingGCRelocateCalls.erase(I);
|
||||
}
|
||||
|
||||
// TODO: Should add consistency tracking to ensure we encounter
|
||||
|
@ -89,6 +89,7 @@ public:
|
|||
assert(NextSlotToAllocate <= (unsigned)Offset && "consistency!");
|
||||
AllocatedStackSlots.set(Offset);
|
||||
}
|
||||
|
||||
bool isStackSlotAllocated(int Offset) {
|
||||
assert(Offset >= 0 && Offset < (int)AllocatedStackSlots.size() &&
|
||||
"out of bounds");
|
||||
|
|
Loading…
Reference in New Issue