mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
libswift: Add the StackList data structure
StackList is a very efficient data structure for worklist type things. This is a port of the C++ utility with the same name. Compared to Array, it does not require any memory allocations.
This commit is contained in:
@@ -52,10 +52,17 @@ class LibswiftPassInvocation {
|
||||
/// Non-null if this is an instruction pass, invoked from SILCombine.
|
||||
SILCombiner *silCombiner;
|
||||
|
||||
/// All slabs, allocated by the pass.
|
||||
SILModule::SlabList allocatedSlabs;
|
||||
|
||||
public:
|
||||
LibswiftPassInvocation(SILPassManager *passManager, SILCombiner *silCombiner) :
|
||||
passManager(passManager), silCombiner(silCombiner) {}
|
||||
|
||||
FixedSizeSlab *allocSlab(FixedSizeSlab *afterSlab);
|
||||
|
||||
FixedSizeSlab *freeSlab(FixedSizeSlab *slab);
|
||||
|
||||
/// The top-level API to erase an instruction, called from the Swift pass.
|
||||
void eraseInstruction(SILInstruction *inst);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user