mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
MIR Serialization: Serialize the fixed stack objects.
This commit serializes the fixed stack objects, including fixed spill slots. The fixed stack objects are serialized using a YAML sequence of YAML inline mappings. Each mapping has the object's ID, type, size, offset, and alignment. The objects that aren't spill slots also serialize the isImmutable and isAliased flags. The fixed stack objects are a part of the machine function's YAML mapping. Reviewers: Duncan P. N. Exon Smith git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242045 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -157,7 +157,29 @@ void MIRPrinter::convert(yaml::MachineFrameInfo &YamlMFI,
|
||||
|
||||
void MIRPrinter::convertStackObjects(yaml::MachineFunction &MF,
|
||||
const MachineFrameInfo &MFI) {
|
||||
// Process fixed stack objects.
|
||||
unsigned ID = 0;
|
||||
for (int I = MFI.getObjectIndexBegin(); I < 0; ++I) {
|
||||
if (MFI.isDeadObjectIndex(I))
|
||||
continue;
|
||||
|
||||
yaml::FixedMachineStackObject YamlObject;
|
||||
YamlObject.ID = ID++;
|
||||
YamlObject.Type = MFI.isSpillSlotObjectIndex(I)
|
||||
? yaml::FixedMachineStackObject::SpillSlot
|
||||
: yaml::FixedMachineStackObject::DefaultType;
|
||||
YamlObject.Offset = MFI.getObjectOffset(I);
|
||||
YamlObject.Size = MFI.getObjectSize(I);
|
||||
YamlObject.Alignment = MFI.getObjectAlignment(I);
|
||||
YamlObject.IsImmutable = MFI.isImmutableObjectIndex(I);
|
||||
YamlObject.IsAliased = MFI.isAliasedObjectIndex(I);
|
||||
MF.FixedStackObjects.push_back(YamlObject);
|
||||
// TODO: Store the mapping between fixed object IDs and object indices to
|
||||
// print the fixed stack object references correctly.
|
||||
}
|
||||
|
||||
// Process ordinary stack objects.
|
||||
ID = 0;
|
||||
for (int I = 0, E = MFI.getObjectIndexEnd(); I < E; ++I) {
|
||||
if (MFI.isDeadObjectIndex(I))
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user