mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
MIR Serialization: Initial serialization of stack objects.
This commit implements the initial serialization of stack objects from the MachineFrameInfo class. It can only serialize the ordinary stack objects (including ordinary spill slots), but it doesn't serialize variable sized or fixed stack objects yet. The 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 stack objects are a part of machine function's YAML mapping. Reviewers: Duncan P. N. Exon Smith git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -107,7 +107,7 @@ public:
|
||||
const yaml::MachineFunction &YamlMF);
|
||||
|
||||
bool initializeFrameInfo(MachineFrameInfo &MFI,
|
||||
const yaml::MachineFrameInfo &YamlMFI);
|
||||
const yaml::MachineFunction &YamlMF);
|
||||
|
||||
private:
|
||||
/// Return a MIR diagnostic converted from an MI string diagnostic.
|
||||
@ -260,7 +260,7 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||
MF.setHasInlineAsm(YamlMF.HasInlineAsm);
|
||||
if (initializeRegisterInfo(MF, MF.getRegInfo(), YamlMF))
|
||||
return true;
|
||||
if (initializeFrameInfo(*MF.getFrameInfo(), YamlMF.FrameInfo))
|
||||
if (initializeFrameInfo(*MF.getFrameInfo(), YamlMF))
|
||||
return true;
|
||||
|
||||
PerFunctionMIParsingState PFS;
|
||||
@ -354,7 +354,8 @@ bool MIRParserImpl::initializeRegisterInfo(
|
||||
}
|
||||
|
||||
bool MIRParserImpl::initializeFrameInfo(MachineFrameInfo &MFI,
|
||||
const yaml::MachineFrameInfo &YamlMFI) {
|
||||
const yaml::MachineFunction &YamlMF) {
|
||||
const yaml::MachineFrameInfo &YamlMFI = YamlMF.FrameInfo;
|
||||
MFI.setFrameAddressIsTaken(YamlMFI.IsFrameAddressTaken);
|
||||
MFI.setReturnAddressIsTaken(YamlMFI.IsReturnAddressTaken);
|
||||
MFI.setHasStackMap(YamlMFI.HasStackMap);
|
||||
@ -369,6 +370,16 @@ bool MIRParserImpl::initializeFrameInfo(MachineFrameInfo &MFI,
|
||||
MFI.setHasOpaqueSPAdjustment(YamlMFI.HasOpaqueSPAdjustment);
|
||||
MFI.setHasVAStart(YamlMFI.HasVAStart);
|
||||
MFI.setHasMustTailInVarArgFunc(YamlMFI.HasMustTailInVarArgFunc);
|
||||
|
||||
// Initialize the frame objects.
|
||||
for (const auto &Object : YamlMF.StackObjects) {
|
||||
int ObjectIdx = MFI.CreateStackObject(
|
||||
Object.Size, Object.Alignment,
|
||||
Object.Type == yaml::MachineStackObject::SpillSlot);
|
||||
MFI.setObjectOffset(ObjectIdx, Object.Offset);
|
||||
// TODO: Store the mapping between object IDs and object indices to parse
|
||||
// stack object references correctly.
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user