15Expected<std::vector<WrapperFunctionCall>>
17 std::vector<WrapperFunctionCall> DeallocActions;
20 for (
auto &AA : AAs) {
22 if (
auto Err = AA.Finalize.runWithSPSRetErrorMerged())
26 DeallocActions.push_back(std::move(AA.Dealloc));
30 return DeallocActions;
35 while (!DAs.
empty()) {
36 Err =
joinErrors(std::move(Err), DAs.
back().runWithSPSRetErrorMerged());
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.
size_t numDeallocActions(const AllocActions &AAs)
Returns the number of deallocaton actions in the given AllocActions array.
Error runDeallocActions(ArrayRef< WrapperFunctionCall > DAs)
Run deallocation actions.
Expected< std::vector< WrapperFunctionCall > > runFinalizeActions(AllocActions &AAs)
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.