Go to the documentation of this file.
14 #ifndef LLVM_CODEGEN_MIRYAMLMAPPING_H
15 #define LLVM_CODEGEN_MIRYAMLMAPPING_H
53 S.Value = Scalar.str();
54 if (
const auto *
Node =
55 reinterpret_cast<yaml::Input *
>(Ctx)->getCurrentNode())
118 if (
const auto *
Node =
119 reinterpret_cast<yaml::Input *
>(Ctx)->getCurrentNode())
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",
148 out <<
uint64_t(Alignment ? Alignment->value() : 0U);
151 unsigned long long n;
153 return "invalid number";
155 return "must be 0 or a power of two";
162 template <>
struct ScalarTraits<
Align> {
164 OS << Alignment.value();
167 unsigned long long N;
169 return "invalid number";
171 return "must be a power of two";
205 YamlIO.mapOptional(
"preferred-register",
Reg.PreferredRegister,
209 static const bool flow =
true;
230 static const bool flow =
true;
285 YamlIO.mapOptional(
"offset",
Object.Offset, (int64_t)0);
290 YamlIO.mapOptional(
"callee-saved-register",
Object.CalleeSavedRegister,
292 YamlIO.mapOptional(
"callee-saved-restored",
Object.CalleeSavedRestored,
295 YamlIO.mapOptional(
"debug-info-variable",
Object.DebugVar,
297 YamlIO.mapOptional(
"debug-info-expression",
Object.DebugExpr,
299 YamlIO.mapOptional(
"debug-info-location",
Object.DebugLoc,
303 static const bool flow =
true;
346 struct ScalarEnumerationTraits<TargetStackID::
Value> {
362 YamlIO.mapOptional(
"offset",
Object.Offset, (int64_t)0);
367 YamlIO.mapOptional(
"isImmutable",
Object.IsImmutable,
false);
368 YamlIO.mapOptional(
"isAliased",
Object.IsAliased,
false);
370 YamlIO.mapOptional(
"callee-saved-register",
Object.CalleeSavedRegister,
372 YamlIO.mapOptional(
"callee-saved-restored",
Object.CalleeSavedRestored,
374 YamlIO.mapOptional(
"debug-info-variable",
Object.DebugVar,
376 YamlIO.mapOptional(
"debug-info-expression",
Object.DebugExpr,
378 YamlIO.mapOptional(
"debug-info-location",
Object.DebugLoc,
382 static const bool flow =
true;
409 if (Scalar.startswith(
"%stack.")) {
410 Num = Scalar.substr(7);
411 }
else if (Scalar.startswith(
"%fixed-stack.")) {
412 Num = Scalar.substr(13);
415 return "Invalid frame index, needs to start with %stack. or "
419 return "Invalid frame index, not a valid number";
421 if (
const auto *
Node =
422 reinterpret_cast<yaml::Input *
>(Ctx)->getCurrentNode())
468 static const bool flow =
true;
483 std::vector<CallSiteInfo::ArgRegPair>());
486 static const bool flow =
true;
512 static const bool flow =
true;
539 YamlIO.mapOptional(
"isTargetSpecific",
Constant.IsTargetSpecific,
false);
563 YamlIO.mapRequired(
"id", Entry.ID);
564 YamlIO.mapOptional(
"blocks", Entry.Blocks, std::vector<FlowStringValue>());
584 YamlIO.mapRequired(
"kind",
JT.Kind);
585 YamlIO.mapOptional(
"entries",
JT.Entries,
586 std::vector<MachineJumpTable::Entry>());
632 Other.CVBytesOfCalleeSavedRegisters &&
658 YamlIO.mapOptional(
"cvBytesOfCalleeSavedRegisters",
682 static void mapping(IO &
YamlIO, std::unique_ptr<MachineFunctionInfo> &MFI) {
748 std::vector<VirtualRegisterDefinition>());
750 std::vector<MachineFunctionLiveIn>());
752 Optional<std::vector<FlowStringValue>>());
755 std::vector<FixedMachineStackObject>());
757 std::vector<MachineStackObject>());
759 std::vector<CallSiteInfo>());
761 std::vector<DebugValueSubstitution>());
763 std::vector<MachineConstantPoolValue>());
769 std::vector<StringValue>());
777 #endif // LLVM_CODEGEN_MIRYAMLMAPPING_H
static void output(const StringValue &S, void *, raw_ostream &OS)
FlowStringValue(std::string Value)
std::vector< ArgRegPair > ArgForwardingRegs
This is an optimization pass for GlobalISel generic memory operations.
static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS)
SMRange getSourceRange() const
static void mapping(IO &YamlIO, CallSiteInfo::ArgRegPair &ArgReg)
static QuotingType mustQuote(StringRef S)
Targets should override this in a way that mirrors the implementation of llvm::MachineFunctionInfo.
static void mapping(IO &YamlIO, MachineFrameInfo &MFI)
MachineJumpTable JumpTableInfo
Abstract base class for all Nodes.
static void printStackObjectReference(raw_ostream &OS, unsigned FrameIndex, bool IsFixed, StringRef Name)
Print a stack object reference.
StringValue PreferredRegister
std::vector< MachineStackObject > StackObjects
Reg
All possible values of the reg field in the ModR/M byte.
static QuotingType mustQuote(StringRef)
Serializable representation of stack object from the MachineFrameInfo class.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
static void output(const FrameIndex &FI, void *, raw_ostream &OS)
StringValue CalleeSavedRegister
The instances of the Type class are immutable: once they are created, they are never changed.
static void mapping(IO &YamlIO, MachineJumpTable &JT)
virtual void mappingImpl(IO &YamlIO)
bool operator==(const Entry &Other) const
@ EK_BlockAddress
EK_BlockAddress - Each entry is a plain address of block, e.g.
bool operator==(const MachineInstrLoc &Other) const
static StringRef input(StringRef Scalar, void *Ctx, FlowStringValue &S)
Tagged union holding either a T or a Error.
Serializable representation of CallSiteInfo.
bool operator==(const MachineConstantPoolValue &Other) const
bool operator==(const MachineFunctionLiveIn &Other) const
@ EK_Custom32
EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the TargetLowering::LowerCustomJ...
Serializable representation of debug value substitutions.
unsigned CVBytesOfCalleeSavedRegisters
static void mapping(IO &YamlIO, std::unique_ptr< MachineFunctionInfo > &MFI)
static void mapping(IO &YamlIO, DebugValueSubstitution &Sub)
TargetStackID::Value StackID
static void output(const MaybeAlign &Alignment, void *, llvm::raw_ostream &out)
static StringRef input(StringRef Scalar, void *Ctx, FrameIndex &FI)
static QuotingType mustQuote(StringRef S)
static void output(const FlowStringValue &S, void *, raw_ostream &OS)
StringValue CalleeSavedRegister
bool operator==(const CallSiteInfo &Other) const
MachineInstrLoc CallLocation
std::unique_ptr< MachineFunctionInfo > MachineFuncInfo
Constant pool.
bool getAsUnsignedInteger(StringRef Str, unsigned Radix, unsigned long long &Result)
Helper functions for StringRef::getAsInteger.
bool operator==(const VirtualRegisterDefinition &Other) const
static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S)
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
bool operator==(const UnsignedValue &Other) const
TargetStackID::Value StackID
bool operator==(const FixedMachineStackObject &Other) const
This class implements an extremely fast bulk output stream that can only output to a stream.
Optional< std::vector< FlowStringValue > > CalleeSavedRegisters
MachineFrameInfo FrameInfo
The initial backend is deliberately restricted to z10 We should add support for later architectures at some point If an asm ties an i32 r result to an i64 input
This struct is a compact representation of a valid (non-zero power of two) alignment.
StringValue(std::string Value)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ EK_LabelDifference32
EK_LabelDifference32 - Each entry is the address of the block minus the address of the jump table.
Serializable representation of the fixed stack object from the MachineFrameInfo class.
StringValue StackProtector
Value(Type *Ty, unsigned scid)
FlowStringValue()=default
@ EK_GPRel64BlockAddress
EK_GPRel64BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...
This is an important base class in LLVM.
static StringRef input(StringRef Scalar, void *, MaybeAlign &Alignment)
bool operator==(const ArgRegPair &Other) const
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
StringValue FunctionContext
static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry)
static void mapping(IO &YamlIO, MachineConstantPoolValue &Constant)
static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object)
std::vector< FlowStringValue > Blocks
bool operator==(const MachineFrameInfo &Other) const
JTEntryKind
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted.
StringValue VirtualRegister
static void mapping(yaml::IO &YamlIO, MachineStackObject &Object)
std::vector< FixedMachineStackObject > FixedStackObjects
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Optional< int64_t > LocalOffset
static QuotingType mustQuote(StringRef Scalar)
bool operator==(const MachineJumpTable &Other) const
static void enumeration(yaml::IO &IO, FixedMachineStackObject::ObjectType &Type)
A wrapper around std::string which contains a source range that's being set during parsing.
static void output(const Align &Alignment, void *, llvm::raw_ostream &OS)
bool HasOpaqueSPAdjustment
static void enumeration(yaml::IO &IO, MachineJumpTableInfo::JTEntryKind &EntryKind)
std::vector< Entry > Entries
unsigned MaxCallFrameSize
~0u means: not computed yet.
StringRef - Represent a constant reference to a string, i.e.
MachineJumpTableInfo::JTEntryKind Kind
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
std::enable_if_t< std::numeric_limits< T >::is_signed, bool > consumeInteger(unsigned Radix, T &Result)
Parse the current string as an integer of the specified radix.
bool operator==(const BlockStringValue &Other) const
Wrapper class representing virtual and physical registers.
static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS)
Serializable representation of MachineFrameInfo.
StringValue(const char Val[])
static void mapping(IO &YamlIO, MachineFunction &MF)
std::vector< DebugValueSubstitution > DebugValueSubstitutions
std::vector< VirtualRegisterDefinition > VirtualRegisters
static QuotingType mustQuote(StringRef)
bool IsReturnAddressTaken
UnsignedValue(unsigned Value)
A wrapper around unsigned which contains a source range that's being set during parsing.
@ EK_Inline
EK_Inline - Jump table entries are emitted inline at their point of use.
static StringRef input(StringRef Scalar, void *Ctx, StringValue &S)
bool TracksDebugUserValues
A serializaable representation of a reference to a stack object or fixed stack object.
static StringRef input(StringRef Scalar, void *, Align &Alignment)
std::vector< MachineFunctionLiveIn > LiveIns
bool operator==(const MachineStackObject &Other) const
bool operator==(const DebugValueSubstitution &Other) const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
bool HasMustTailInVarArgFunc
Represents a range in source code.
std::vector< StringValue > MachineMetadataNodes
@ EK_GPRel32BlockAddress
EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative,...
Identifies call instruction location in machine function.
Expected< int > getFI(const llvm::MachineFrameInfo &MFI) const
static void enumeration(yaml::IO &IO, TargetStackID::Value &ID)
std::vector< CallSiteInfo > CallSitesInfo
The same transformation can work with an even modulo with the addition of a and shrink the compare RHS by the same amount Unless the target supports that transformation probably isn t worthwhile The transformation can also easily be made to work with non zero equality for n
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
static StringRef input(StringRef Scalar, void *Ctx, UnsignedValue &Value)
LLVM Value Representation.
virtual ~MachineFunctionInfo()=default
static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type)
static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn)
static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg)
std::vector< MachineConstantPoolValue > Constants
static QuotingType mustQuote(StringRef S)
Optional< std::vector< StOtherPiece > > Other
static void mapping(IO &YamlIO, CallSiteInfo &CSInfo)
bool operator==(const StringValue &Other) const