17 std::vector<WrapperFunctionCall> DeallocActions;
20 for (
auto &AA : AAs) {
23 if (
auto Err = AA.Finalize.runWithSPSRetErrorMerged()) {
24 while (!DeallocActions.empty()) {
26 DeallocActions.back().runWithSPSRetErrorMerged());
27 DeallocActions.pop_back();
29 return OnComplete(std::move(Err));
33 DeallocActions.push_back(std::move(AA.Dealloc));
37 OnComplete(std::move(DeallocActions));
43 while (!DAs.
empty()) {
44 Err =
joinErrors(std::move(Err), DAs.
back().runWithSPSRetErrorMerged());
47 OnComplete(std::move(Err));
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
const T & back() const
back - Get the last element.
ArrayRef< T > drop_back(size_t N=1) const
Drop the last N elements of the array.
bool empty() const
empty - Check if the array is empty.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
unique_function is a type-erasing functor similar to std::function.
size_t numDeallocActions(const AllocActions &AAs)
Returns the number of deallocaton actions in the given AllocActions array.
LLVM_ABI void runDeallocActions(ArrayRef< WrapperFunctionCall > DAs, OnRunDeallocActionsComeleteFn OnComplete)
Run deallocation actions.
LLVM_ABI void runFinalizeActions(AllocActions &AAs, OnRunFinalizeActionsCompleteFn OnComplete)
Run finalize actions.
std::vector< AllocActionCallPair > AllocActions
A vector of allocation actions to be run for this allocation.
This is an optimization pass for GlobalISel generic memory operations.
Error joinErrors(Error E1, Error E2)
Concatenate errors.