| 123456789101112131415161718192021222324252627 |
- using ARMeilleure.Common;
- using ARMeilleure.IntermediateRepresentation;
- using System;
- namespace ARMeilleure.CodeGen.RegisterAllocators
- {
- class StackAllocator
- {
- private int _offset;
- public int TotalSize => _offset;
- public int Allocate(OperandType type)
- {
- return Allocate(type.GetSizeInBytes());
- }
- public int Allocate(int sizeInBytes)
- {
- int offset = _offset;
- _offset += sizeInBytes;
- return offset;
- }
- }
- }
|