14 #ifndef LLVM_CODEGEN_MIRYAMLMAPPING_H 15 #define LLVM_CODEGEN_MIRYAMLMAPPING_H 43 return Value == Other.
Value;
54 if (
const auto *
Node =
55 reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
84 return Value == Other.
Value;
108 return Value == Other.
Value;
114 return ScalarTraits<unsigned>::output(Value.
Value, Ctx, OS);
118 if (
const auto *
Node =
119 reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
121 return ScalarTraits<unsigned>::input(Scalar, Ctx, Value.
Value);
125 return ScalarTraits<unsigned>::mustQuote(Scalar);
132 IO.enumCase(EntryKind,
"block-address",
134 IO.enumCase(EntryKind,
"gp-rel64-block-address",
136 IO.enumCase(EntryKind,
"gp-rel32-block-address",
138 IO.enumCase(EntryKind,
"label-difference32",
163 return ID == Other.
ID && Class == Other.
Class &&
170 YamlIO.mapRequired(
"id", Reg.
ID);
171 YamlIO.mapRequired(
"class", Reg.
Class);
176 static const bool flow =
true;
184 return Register == Other.
Register &&
191 YamlIO.mapRequired(
"reg", LiveIn.
Register);
197 static const bool flow =
true;
215 unsigned Alignment = 0;
218 bool CalleeSavedRestored =
true;
225 return ID == Other.
ID && Name == Other.
Name && Type == Other.
Type &&
226 Offset == Other.
Offset && Size == Other.
Size &&
246 YamlIO.mapRequired(
"id", Object.
ID);
247 YamlIO.mapOptional(
"name", Object.
Name,
252 YamlIO.mapOptional(
"offset", Object.
Offset, (int64_t)0);
254 YamlIO.mapRequired(
"size", Object.
Size);
255 YamlIO.mapOptional(
"alignment", Object.
Alignment, (
unsigned)0);
262 YamlIO.mapOptional(
"debug-info-variable", Object.
DebugVar,
264 YamlIO.mapOptional(
"debug-info-expression", Object.
DebugExpr,
266 YamlIO.mapOptional(
"debug-info-location", Object.
DebugLoc,
270 static const bool flow =
true;
281 unsigned Alignment = 0;
283 bool IsImmutable =
false;
284 bool IsAliased =
false;
286 bool CalleeSavedRestored =
true;
292 return ID == Other.
ID && Type == Other.
Type && Offset == Other.
Offset &&
313 struct ScalarEnumerationTraits<TargetStackID::
Value> {
324 YamlIO.mapRequired(
"id", Object.
ID);
328 YamlIO.mapOptional(
"offset", Object.
Offset, (int64_t)0);
329 YamlIO.mapOptional(
"size", Object.
Size, (uint64_t)0);
330 YamlIO.mapOptional(
"alignment", Object.
Alignment, (
unsigned)0);
333 YamlIO.mapOptional(
"isImmutable", Object.
IsImmutable,
false);
334 YamlIO.mapOptional(
"isAliased", Object.
IsAliased,
false);
340 YamlIO.mapOptional(
"debug-info-variable", Object.
DebugVar,
342 YamlIO.mapOptional(
"debug-info-expression", Object.
DebugExpr,
344 YamlIO.mapOptional(
"debug-info-location", Object.
DebugLoc,
348 static const bool flow =
true;
361 return Reg == Other.
Reg && ArgNo == Other.
ArgNo;
386 YamlIO.mapRequired(
"arg", ArgReg.
ArgNo);
387 YamlIO.mapRequired(
"reg", ArgReg.
Reg);
390 static const bool flow =
true;
405 std::vector<CallSiteInfo::ArgRegPair>());
408 static const bool flow =
true;
414 unsigned Alignment = 0;
415 bool IsTargetSpecific =
false;
418 return ID == Other.
ID && Value == Other.
Value &&
426 YamlIO.mapRequired(
"id", Constant.
ID);
428 YamlIO.mapOptional(
"alignment", Constant.
Alignment, (
unsigned)0);
439 return ID == Other.
ID && Blocks == Other.
Blocks;
447 return Kind == Other.
Kind && Entries == Other.
Entries;
453 YamlIO.mapRequired(
"id", Entry.
ID);
454 YamlIO.mapOptional(
"blocks", Entry.
Blocks, std::vector<FlowStringValue>());
474 YamlIO.mapRequired(
"kind", JT.
Kind);
475 YamlIO.mapOptional(
"entries", JT.
Entries,
476 std::vector<MachineJumpTable::Entry>());
488 bool IsFrameAddressTaken =
false;
489 bool IsReturnAddressTaken =
false;
490 bool HasStackMap =
false;
491 bool HasPatchPoint =
false;
492 uint64_t StackSize = 0;
493 int OffsetAdjustment = 0;
494 unsigned MaxAlignment = 0;
495 bool AdjustsStack =
false;
499 unsigned MaxCallFrameSize = ~0u;
500 unsigned CVBytesOfCalleeSavedRegisters = 0;
501 bool HasOpaqueSPAdjustment =
false;
502 bool HasVAStart =
false;
503 bool HasMustTailInVarArgFunc =
false;
504 unsigned LocalFrameSize = 0;
519 CVBytesOfCalleeSavedRegisters ==
533 YamlIO.mapOptional(
"hasStackMap", MFI.
HasStackMap,
false);
534 YamlIO.mapOptional(
"hasPatchPoint", MFI.
HasPatchPoint,
false);
535 YamlIO.mapOptional(
"stackSize", MFI.
StackSize, (uint64_t)0);
537 YamlIO.mapOptional(
"maxAlignment", MFI.
MaxAlignment, (
unsigned)0);
538 YamlIO.mapOptional(
"adjustsStack", MFI.
AdjustsStack,
false);
539 YamlIO.mapOptional(
"hasCalls", MFI.
HasCalls,
false);
543 YamlIO.mapOptional(
"cvBytesOfCalleeSavedRegisters",
547 YamlIO.mapOptional(
"hasVAStart", MFI.
HasVAStart,
false);
550 YamlIO.mapOptional(
"localFrameSize", MFI.
LocalFrameSize, (
unsigned)0);
551 YamlIO.mapOptional(
"savePoint", MFI.
SavePoint,
566 static void mapping(IO &
YamlIO, std::unique_ptr<MachineFunctionInfo> &MFI) {
568 MFI->mappingImpl(YamlIO);
574 unsigned Alignment = 0;
575 bool ExposesReturnsTwice =
false;
577 bool Legalized =
false;
578 bool RegBankSelected =
false;
579 bool Selected =
false;
580 bool FailedISel =
false;
582 bool TracksRegLiveness =
false;
583 bool HasWinCFI =
false;
601 YamlIO.mapRequired(
"name", MF.
Name);
602 YamlIO.mapOptional(
"alignment", MF.
Alignment, (
unsigned)0);
604 YamlIO.mapOptional(
"legalized", MF.
Legalized,
false);
606 YamlIO.mapOptional(
"selected", MF.
Selected,
false);
607 YamlIO.mapOptional(
"failedISel", MF.
FailedISel,
false);
609 YamlIO.mapOptional(
"hasWinCFI", MF.
HasWinCFI,
false);
611 std::vector<VirtualRegisterDefinition>());
612 YamlIO.mapOptional(
"liveins", MF.
LiveIns,
613 std::vector<MachineFunctionLiveIn>());
615 Optional<std::vector<FlowStringValue>>());
618 std::vector<FixedMachineStackObject>());
620 std::vector<MachineStackObject>());
622 std::vector<CallSiteInfo>());
623 YamlIO.mapOptional(
"constants", MF.
Constants,
624 std::vector<MachineConstantPoolValue>());
635 #endif // LLVM_CODEGEN_MIRYAMLMAPPING_H
Represents a range in source code.
StringValue VirtualRegister
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
StringValue(const char Val[])
This class represents lattice values for constants.
static StringRef input(StringRef Scalar, void *Ctx, StringValue &S)
static void mapping(IO &YamlIO, MachineConstantPoolValue &Constant)
static void output(const FlowStringValue &S, void *, raw_ostream &OS)
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
Serializable representation of CallSiteInfo.
static QuotingType mustQuote(StringRef S)
EK_Inline - Jump table entries are emitted inline at their point of use.
bool operator==(const ArgRegPair &Other) const
FlowStringValue(std::string Value)
static QuotingType mustQuote(StringRef Scalar)
static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS)
bool operator==(const Entry &Other) const
std::unique_ptr< MachineFunctionInfo > MachineFuncInfo
Constant pool.
static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type)
static void enumeration(yaml::IO &IO, FixedMachineStackObject::ObjectType &Type)
TargetStackID::Value StackID
MachineInstrLoc CallLocation
static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object)
JTEntryKind
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted...
StringValue CalleeSavedRegister
bool operator==(const MachineInstrLoc &Other) const
Serializable representation of the fixed stack object from the MachineFrameInfo class.
bool operator==(const MachineFrameInfo &Other) const
static void mapping(IO &YamlIO, MachineFunction &MF)
std::vector< VirtualRegisterDefinition > VirtualRegisters
EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table...
static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry)
bool operator==(const StringValue &Other) const
bool HasMustTailInVarArgFunc
unsigned CVBytesOfCalleeSavedRegisters
EK_BlockAddress - Each entry is a plain address of block, e.g.
bool operator==(const MachineConstantPoolValue &Other) const
static StringRef input(StringRef Scalar, void *Ctx, UnsignedValue &Value)
EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
std::vector< FlowStringValue > Blocks
EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...
Serializable representation of stack object from the MachineFrameInfo class.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important base class in LLVM.
static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn)
MachineJumpTable JumpTableInfo
Identifies call instruction location in machine function.
static void mapping(IO &YamlIO, std::unique_ptr< MachineFunctionInfo > &MFI)
static void mapping(IO &YamlIO, CallSiteInfo &CSInfo)
unsigned MaxCallFrameSize
~0u means: not computed yet.
static void enumeration(yaml::IO &IO, TargetStackID::Value &ID)
StringValue StackProtector
std::vector< MachineStackObject > StackObjects
virtual void mappingImpl(IO &YamlIO)
Serializable representation of MachineFrameInfo.
bool operator==(const UnsignedValue &Other) const
StringValue(std::string Value)
static void mapping(yaml::IO &YamlIO, MachineStackObject &Object)
StringValue CalleeSavedRegister
static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S)
Optional< int64_t > LocalOffset
static void mapping(IO &YamlIO, CallSiteInfo::ArgRegPair &ArgReg)
StringValue PreferredRegister
bool operator==(const CallSiteInfo &Other) const
MachineFrameInfo FrameInfo
static void mapping(IO &YamlIO, MachineFrameInfo &MFI)
bool HasOpaqueSPAdjustment
static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg)
A wrapper around std::string which contains a source range that's being set during parsing...
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
std::vector< MachineFunctionLiveIn > LiveIns
static void enumeration(yaml::IO &IO, MachineJumpTableInfo::JTEntryKind &EntryKind)
bool operator==(const MachineStackObject &Other) const
static StringRef input(StringRef Scalar, void *Ctx, FlowStringValue &S)
A wrapper around unsigned which contains a source range that's being set during parsing.
std::vector< Entry > Entries
static void mapping(IO &YamlIO, MachineJumpTable &JT)
bool IsReturnAddressTaken
static QuotingType mustQuote(StringRef S)
std::vector< MachineConstantPoolValue > Constants
bool operator==(const BlockStringValue &Other) const
std::vector< CallSiteInfo > CallSitesInfo
bool operator==(const FixedMachineStackObject &Other) const
static void output(const StringValue &S, void *, raw_ostream &OS)
virtual ~MachineFunctionInfo()
std::vector< FixedMachineStackObject > FixedStackObjects
LLVM Value Representation.
bool operator==(const MachineJumpTable &Other) const
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
UnsignedValue(unsigned Value)
EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
TargetStackID::Value StackID
MachineJumpTableInfo::JTEntryKind Kind
static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS)
std::vector< ArgRegPair > ArgForwardingRegs
bool operator==(const VirtualRegisterDefinition &Other) const
bool operator==(const MachineFunctionLiveIn &Other) const
SMRange getSourceRange() const
Abstract base class for all Nodes.