mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 16:24:23 +00:00
MIR Serialization: Serialize the simple MachineFrameInfo attributes.
This commit serializes the 13 scalar boolean and integer attributes from the MachineFrameInfo class: IsFrameAddressTaken, IsReturnAddressTaken, HasStackMap, HasPatchPoint, StackSize, OffsetAdjustment, MaxAlignment, AdjustsStack, HasCalls, MaxCallFrameSize, HasOpaqueSPAdjustment, HasVAStart, and HasMustTailInVarArgFunc. These attributes are serialized as part of the frameInfo YAML mapping, which itself is a part of the machine function's YAML mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241844 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -21,6 +21,7 @@
|
||||
#include "llvm/AsmParser/Parser.h"
|
||||
#include "llvm/AsmParser/SlotMapping.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineRegisterInfo.h"
|
||||
#include "llvm/CodeGen/MIRYamlMapping.h"
|
||||
#include "llvm/IR/BasicBlock.h"
|
||||
@ -102,6 +103,9 @@ public:
|
||||
bool initializeRegisterInfo(MachineRegisterInfo &RegInfo,
|
||||
const yaml::MachineFunction &YamlMF);
|
||||
|
||||
bool initializeFrameInfo(MachineFrameInfo &MFI,
|
||||
const yaml::MachineFrameInfo &YamlMFI);
|
||||
|
||||
private:
|
||||
/// Return a MIR diagnostic converted from an MI string diagnostic.
|
||||
SMDiagnostic diagFromMIStringDiag(const SMDiagnostic &Error,
|
||||
@ -245,6 +249,8 @@ bool MIRParserImpl::initializeMachineFunction(MachineFunction &MF) {
|
||||
MF.setHasInlineAsm(YamlMF.HasInlineAsm);
|
||||
if (initializeRegisterInfo(MF.getRegInfo(), YamlMF))
|
||||
return true;
|
||||
if (initializeFrameInfo(*MF.getFrameInfo(), YamlMF.FrameInfo))
|
||||
return true;
|
||||
|
||||
PerFunctionMIParsingState PFS;
|
||||
const auto &F = *MF.getFunction();
|
||||
@ -320,6 +326,25 @@ bool MIRParserImpl::initializeRegisterInfo(
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MIRParserImpl::initializeFrameInfo(MachineFrameInfo &MFI,
|
||||
const yaml::MachineFrameInfo &YamlMFI) {
|
||||
MFI.setFrameAddressIsTaken(YamlMFI.IsFrameAddressTaken);
|
||||
MFI.setReturnAddressIsTaken(YamlMFI.IsReturnAddressTaken);
|
||||
MFI.setHasStackMap(YamlMFI.HasStackMap);
|
||||
MFI.setHasPatchPoint(YamlMFI.HasPatchPoint);
|
||||
MFI.setStackSize(YamlMFI.StackSize);
|
||||
MFI.setOffsetAdjustment(YamlMFI.OffsetAdjustment);
|
||||
if (YamlMFI.MaxAlignment)
|
||||
MFI.ensureMaxAlignment(YamlMFI.MaxAlignment);
|
||||
MFI.setAdjustsStack(YamlMFI.AdjustsStack);
|
||||
MFI.setHasCalls(YamlMFI.HasCalls);
|
||||
MFI.setMaxCallFrameSize(YamlMFI.MaxCallFrameSize);
|
||||
MFI.setHasOpaqueSPAdjustment(YamlMFI.HasOpaqueSPAdjustment);
|
||||
MFI.setHasVAStart(YamlMFI.HasVAStart);
|
||||
MFI.setHasMustTailInVarArgFunc(YamlMFI.HasMustTailInVarArgFunc);
|
||||
return false;
|
||||
}
|
||||
|
||||
SMDiagnostic MIRParserImpl::diagFromMIStringDiag(const SMDiagnostic &Error,
|
||||
SMRange SourceRange) {
|
||||
assert(SourceRange.isValid() && "Invalid source range");
|
||||
|
Reference in New Issue
Block a user