LLVM  9.0.0svn
MIRYamlMapping.h
Go to the documentation of this file.
1 //===- MIRYamlMapping.h - Describe mapping between MIR and YAML--*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements the mapping between various MIR data structures and
10 // their corresponding YAML representation.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_CODEGEN_MIRYAMLMAPPING_H
15 #define LLVM_CODEGEN_MIRYAMLMAPPING_H
16 
17 #include "llvm/ADT/Optional.h"
18 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/SMLoc.h"
23 #include <algorithm>
24 #include <cstdint>
25 #include <string>
26 #include <vector>
27 
28 namespace llvm {
29 namespace yaml {
30 
31 /// A wrapper around std::string which contains a source range that's being
32 /// set during parsing.
33 struct StringValue {
34  std::string Value;
36 
37  StringValue() = default;
38  StringValue(std::string Value) : Value(std::move(Value)) {}
39  StringValue(const char Val[]) : Value(Val) {}
40 
41  bool operator==(const StringValue &Other) const {
42  return Value == Other.Value;
43  }
44 };
45 
46 template <> struct ScalarTraits<StringValue> {
47  static void output(const StringValue &S, void *, raw_ostream &OS) {
48  OS << S.Value;
49  }
50 
51  static StringRef input(StringRef Scalar, void *Ctx, StringValue &S) {
52  S.Value = Scalar.str();
53  if (const auto *Node =
54  reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
56  return "";
57  }
58 
59  static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
60 };
61 
63  FlowStringValue() = default;
64  FlowStringValue(std::string Value) : StringValue(std::move(Value)) {}
65 };
66 
67 template <> struct ScalarTraits<FlowStringValue> {
68  static void output(const FlowStringValue &S, void *, raw_ostream &OS) {
69  return ScalarTraits<StringValue>::output(S, nullptr, OS);
70  }
71 
72  static StringRef input(StringRef Scalar, void *Ctx, FlowStringValue &S) {
73  return ScalarTraits<StringValue>::input(Scalar, Ctx, S);
74  }
75 
76  static QuotingType mustQuote(StringRef S) { return needsQuotes(S); }
77 };
78 
81 
82  bool operator==(const BlockStringValue &Other) const {
83  return Value == Other.Value;
84  }
85 };
86 
87 template <> struct BlockScalarTraits<BlockStringValue> {
88  static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS) {
89  return ScalarTraits<StringValue>::output(S.Value, Ctx, OS);
90  }
91 
92  static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S) {
93  return ScalarTraits<StringValue>::input(Scalar, Ctx, S.Value);
94  }
95 };
96 
97 /// A wrapper around unsigned which contains a source range that's being set
98 /// during parsing.
99 struct UnsignedValue {
100  unsigned Value = 0;
102 
103  UnsignedValue() = default;
104  UnsignedValue(unsigned Value) : Value(Value) {}
105 
106  bool operator==(const UnsignedValue &Other) const {
107  return Value == Other.Value;
108  }
109 };
110 
111 template <> struct ScalarTraits<UnsignedValue> {
112  static void output(const UnsignedValue &Value, void *Ctx, raw_ostream &OS) {
113  return ScalarTraits<unsigned>::output(Value.Value, Ctx, OS);
114  }
115 
117  if (const auto *Node =
118  reinterpret_cast<yaml::Input *>(Ctx)->getCurrentNode())
119  Value.SourceRange = Node->getSourceRange();
120  return ScalarTraits<unsigned>::input(Scalar, Ctx, Value.Value);
121  }
122 
123  static QuotingType mustQuote(StringRef Scalar) {
124  return ScalarTraits<unsigned>::mustQuote(Scalar);
125  }
126 };
127 
128 template <> struct ScalarEnumerationTraits<MachineJumpTableInfo::JTEntryKind> {
129  static void enumeration(yaml::IO &IO,
131  IO.enumCase(EntryKind, "block-address",
133  IO.enumCase(EntryKind, "gp-rel64-block-address",
135  IO.enumCase(EntryKind, "gp-rel32-block-address",
137  IO.enumCase(EntryKind, "label-difference32",
139  IO.enumCase(EntryKind, "inline", MachineJumpTableInfo::EK_Inline);
140  IO.enumCase(EntryKind, "custom32", MachineJumpTableInfo::EK_Custom32);
141  }
142 };
143 
144 } // end namespace yaml
145 } // end namespace llvm
146 
147 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::StringValue)
148 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::FlowStringValue)
149 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::UnsignedValue)
150 
151 namespace llvm {
152 namespace yaml {
153 
158 
159  // TODO: Serialize the target specific register hints.
160 
161  bool operator==(const VirtualRegisterDefinition &Other) const {
162  return ID == Other.ID && Class == Other.Class &&
163  PreferredRegister == Other.PreferredRegister;
164  }
165 };
166 
168  static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg) {
169  YamlIO.mapRequired("id", Reg.ID);
170  YamlIO.mapRequired("class", Reg.Class);
171  YamlIO.mapOptional("preferred-register", Reg.PreferredRegister,
172  StringValue()); // Don't print out when it's empty.
173  }
174 
175  static const bool flow = true;
176 };
177 
181 
182  bool operator==(const MachineFunctionLiveIn &Other) const {
183  return Register == Other.Register &&
184  VirtualRegister == Other.VirtualRegister;
185  }
186 };
187 
189  static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn) {
190  YamlIO.mapRequired("reg", LiveIn.Register);
191  YamlIO.mapOptional(
192  "virtual-reg", LiveIn.VirtualRegister,
193  StringValue()); // Don't print the virtual register when it's empty.
194  }
195 
196  static const bool flow = true;
197 };
198 
199 /// Serializable representation of stack object from the MachineFrameInfo class.
200 ///
201 /// The flags 'isImmutable' and 'isAliased' aren't serialized, as they are
202 /// determined by the object's type and frame information flags.
203 /// Dead stack objects aren't serialized.
204 ///
205 /// The 'isPreallocated' flag is determined by the local offset.
207  enum ObjectType { DefaultType, SpillSlot, VariableSized };
210  // TODO: Serialize unnamed LLVM alloca reference.
211  ObjectType Type = DefaultType;
212  int64_t Offset = 0;
213  uint64_t Size = 0;
214  unsigned Alignment = 0;
215  uint8_t StackID = 0;
217  bool CalleeSavedRestored = true;
222 
223  bool operator==(const MachineStackObject &Other) const {
224  return ID == Other.ID && Name == Other.Name && Type == Other.Type &&
225  Offset == Other.Offset && Size == Other.Size &&
226  Alignment == Other.Alignment &&
227  StackID == Other.StackID &&
228  CalleeSavedRegister == Other.CalleeSavedRegister &&
229  CalleeSavedRestored == Other.CalleeSavedRestored &&
230  LocalOffset == Other.LocalOffset && DebugVar == Other.DebugVar &&
231  DebugExpr == Other.DebugExpr && DebugLoc == Other.DebugLoc;
232  }
233 };
234 
235 template <> struct ScalarEnumerationTraits<MachineStackObject::ObjectType> {
236  static void enumeration(yaml::IO &IO, MachineStackObject::ObjectType &Type) {
237  IO.enumCase(Type, "default", MachineStackObject::DefaultType);
238  IO.enumCase(Type, "spill-slot", MachineStackObject::SpillSlot);
239  IO.enumCase(Type, "variable-sized", MachineStackObject::VariableSized);
240  }
241 };
242 
243 template <> struct MappingTraits<MachineStackObject> {
244  static void mapping(yaml::IO &YamlIO, MachineStackObject &Object) {
245  YamlIO.mapRequired("id", Object.ID);
246  YamlIO.mapOptional("name", Object.Name,
247  StringValue()); // Don't print out an empty name.
248  YamlIO.mapOptional(
249  "type", Object.Type,
250  MachineStackObject::DefaultType); // Don't print the default type.
251  YamlIO.mapOptional("offset", Object.Offset, (int64_t)0);
253  YamlIO.mapRequired("size", Object.Size);
254  YamlIO.mapOptional("alignment", Object.Alignment, (unsigned)0);
255  YamlIO.mapOptional("stack-id", Object.StackID);
256  YamlIO.mapOptional("callee-saved-register", Object.CalleeSavedRegister,
257  StringValue()); // Don't print it out when it's empty.
258  YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored,
259  true);
260  YamlIO.mapOptional("local-offset", Object.LocalOffset, Optional<int64_t>());
261  YamlIO.mapOptional("debug-info-variable", Object.DebugVar,
262  StringValue()); // Don't print it out when it's empty.
263  YamlIO.mapOptional("debug-info-expression", Object.DebugExpr,
264  StringValue()); // Don't print it out when it's empty.
265  YamlIO.mapOptional("debug-info-location", Object.DebugLoc,
266  StringValue()); // Don't print it out when it's empty.
267  }
268 
269  static const bool flow = true;
270 };
271 
272 /// Serializable representation of the fixed stack object from the
273 /// MachineFrameInfo class.
275  enum ObjectType { DefaultType, SpillSlot };
277  ObjectType Type = DefaultType;
278  int64_t Offset = 0;
279  uint64_t Size = 0;
280  unsigned Alignment = 0;
281  uint8_t StackID = 0;
282  bool IsImmutable = false;
283  bool IsAliased = false;
285  bool CalleeSavedRestored = true;
289 
290  bool operator==(const FixedMachineStackObject &Other) const {
291  return ID == Other.ID && Type == Other.Type && Offset == Other.Offset &&
292  Size == Other.Size && Alignment == Other.Alignment &&
293  StackID == Other.StackID &&
294  IsImmutable == Other.IsImmutable && IsAliased == Other.IsAliased &&
295  CalleeSavedRegister == Other.CalleeSavedRegister &&
296  CalleeSavedRestored == Other.CalleeSavedRestored &&
297  DebugVar == Other.DebugVar && DebugExpr == Other.DebugExpr
298  && DebugLoc == Other.DebugLoc;
299  }
300 };
301 
302 template <>
303 struct ScalarEnumerationTraits<FixedMachineStackObject::ObjectType> {
304  static void enumeration(yaml::IO &IO,
306  IO.enumCase(Type, "default", FixedMachineStackObject::DefaultType);
307  IO.enumCase(Type, "spill-slot", FixedMachineStackObject::SpillSlot);
308  }
309 };
310 
312  static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object) {
313  YamlIO.mapRequired("id", Object.ID);
314  YamlIO.mapOptional(
315  "type", Object.Type,
316  FixedMachineStackObject::DefaultType); // Don't print the default type.
317  YamlIO.mapOptional("offset", Object.Offset, (int64_t)0);
318  YamlIO.mapOptional("size", Object.Size, (uint64_t)0);
319  YamlIO.mapOptional("alignment", Object.Alignment, (unsigned)0);
320  YamlIO.mapOptional("stack-id", Object.StackID);
322  YamlIO.mapOptional("isImmutable", Object.IsImmutable, false);
323  YamlIO.mapOptional("isAliased", Object.IsAliased, false);
324  }
325  YamlIO.mapOptional("callee-saved-register", Object.CalleeSavedRegister,
326  StringValue()); // Don't print it out when it's empty.
327  YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored,
328  true);
329  YamlIO.mapOptional("debug-info-variable", Object.DebugVar,
330  StringValue()); // Don't print it out when it's empty.
331  YamlIO.mapOptional("debug-info-expression", Object.DebugExpr,
332  StringValue()); // Don't print it out when it's empty.
333  YamlIO.mapOptional("debug-info-location", Object.DebugLoc,
334  StringValue()); // Don't print it out when it's empty.
335  }
336 
337  static const bool flow = true;
338 };
339 
343  unsigned Alignment = 0;
344  bool IsTargetSpecific = false;
345 
346  bool operator==(const MachineConstantPoolValue &Other) const {
347  return ID == Other.ID && Value == Other.Value &&
348  Alignment == Other.Alignment &&
349  IsTargetSpecific == Other.IsTargetSpecific;
350  }
351 };
352 
354  static void mapping(IO &YamlIO, MachineConstantPoolValue &Constant) {
355  YamlIO.mapRequired("id", Constant.ID);
356  YamlIO.mapOptional("value", Constant.Value, StringValue());
357  YamlIO.mapOptional("alignment", Constant.Alignment, (unsigned)0);
358  YamlIO.mapOptional("isTargetSpecific", Constant.IsTargetSpecific, false);
359  }
360 };
361 
363  struct Entry {
365  std::vector<FlowStringValue> Blocks;
366 
367  bool operator==(const Entry &Other) const {
368  return ID == Other.ID && Blocks == Other.Blocks;
369  }
370  };
371 
373  std::vector<Entry> Entries;
374 
375  bool operator==(const MachineJumpTable &Other) const {
376  return Kind == Other.Kind && Entries == Other.Entries;
377  }
378 };
379 
380 template <> struct MappingTraits<MachineJumpTable::Entry> {
381  static void mapping(IO &YamlIO, MachineJumpTable::Entry &Entry) {
382  YamlIO.mapRequired("id", Entry.ID);
383  YamlIO.mapOptional("blocks", Entry.Blocks, std::vector<FlowStringValue>());
384  }
385 };
386 
387 } // end namespace yaml
388 } // end namespace llvm
389 
390 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineFunctionLiveIn)
391 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::VirtualRegisterDefinition)
392 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineStackObject)
393 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::FixedMachineStackObject)
394 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineConstantPoolValue)
395 LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::MachineJumpTable::Entry)
396 
397 namespace llvm {
398 namespace yaml {
399 
400 template <> struct MappingTraits<MachineJumpTable> {
401  static void mapping(IO &YamlIO, MachineJumpTable &JT) {
402  YamlIO.mapRequired("kind", JT.Kind);
403  YamlIO.mapOptional("entries", JT.Entries,
404  std::vector<MachineJumpTable::Entry>());
405  }
406 };
407 
408 /// Serializable representation of MachineFrameInfo.
409 ///
410 /// Doesn't serialize attributes like 'StackAlignment', 'IsStackRealignable' and
411 /// 'RealignOption' as they are determined by the target and LLVM function
412 /// attributes.
413 /// It also doesn't serialize attributes like 'NumFixedObject' and
414 /// 'HasVarSizedObjects' as they are determined by the frame objects themselves.
416  bool IsFrameAddressTaken = false;
417  bool IsReturnAddressTaken = false;
418  bool HasStackMap = false;
419  bool HasPatchPoint = false;
420  uint64_t StackSize = 0;
421  int OffsetAdjustment = 0;
422  unsigned MaxAlignment = 0;
423  bool AdjustsStack = false;
424  bool HasCalls = false;
426  // TODO: Serialize FunctionContextIdx
427  unsigned MaxCallFrameSize = ~0u; ///< ~0u means: not computed yet.
428  unsigned CVBytesOfCalleeSavedRegisters = 0;
429  bool HasOpaqueSPAdjustment = false;
430  bool HasVAStart = false;
431  bool HasMustTailInVarArgFunc = false;
432  unsigned LocalFrameSize = 0;
435 
436  bool operator==(const MachineFrameInfo &Other) const {
437  return IsFrameAddressTaken == Other.IsFrameAddressTaken &&
438  IsReturnAddressTaken == Other.IsReturnAddressTaken &&
439  HasStackMap == Other.HasStackMap &&
440  HasPatchPoint == Other.HasPatchPoint &&
441  StackSize == Other.StackSize &&
442  OffsetAdjustment == Other.OffsetAdjustment &&
443  MaxAlignment == Other.MaxAlignment &&
444  AdjustsStack == Other.AdjustsStack && HasCalls == Other.HasCalls &&
445  StackProtector == Other.StackProtector &&
446  MaxCallFrameSize == Other.MaxCallFrameSize &&
447  CVBytesOfCalleeSavedRegisters ==
449  HasOpaqueSPAdjustment == Other.HasOpaqueSPAdjustment &&
450  HasVAStart == Other.HasVAStart &&
451  HasMustTailInVarArgFunc == Other.HasMustTailInVarArgFunc &&
452  LocalFrameSize == Other.LocalFrameSize &&
453  SavePoint == Other.SavePoint && RestorePoint == Other.RestorePoint;
454  }
455 };
456 
457 template <> struct MappingTraits<MachineFrameInfo> {
458  static void mapping(IO &YamlIO, MachineFrameInfo &MFI) {
459  YamlIO.mapOptional("isFrameAddressTaken", MFI.IsFrameAddressTaken, false);
460  YamlIO.mapOptional("isReturnAddressTaken", MFI.IsReturnAddressTaken, false);
461  YamlIO.mapOptional("hasStackMap", MFI.HasStackMap, false);
462  YamlIO.mapOptional("hasPatchPoint", MFI.HasPatchPoint, false);
463  YamlIO.mapOptional("stackSize", MFI.StackSize, (uint64_t)0);
464  YamlIO.mapOptional("offsetAdjustment", MFI.OffsetAdjustment, (int)0);
465  YamlIO.mapOptional("maxAlignment", MFI.MaxAlignment, (unsigned)0);
466  YamlIO.mapOptional("adjustsStack", MFI.AdjustsStack, false);
467  YamlIO.mapOptional("hasCalls", MFI.HasCalls, false);
468  YamlIO.mapOptional("stackProtector", MFI.StackProtector,
469  StringValue()); // Don't print it out when it's empty.
470  YamlIO.mapOptional("maxCallFrameSize", MFI.MaxCallFrameSize, (unsigned)~0);
471  YamlIO.mapOptional("cvBytesOfCalleeSavedRegisters",
473  YamlIO.mapOptional("hasOpaqueSPAdjustment", MFI.HasOpaqueSPAdjustment,
474  false);
475  YamlIO.mapOptional("hasVAStart", MFI.HasVAStart, false);
476  YamlIO.mapOptional("hasMustTailInVarArgFunc", MFI.HasMustTailInVarArgFunc,
477  false);
478  YamlIO.mapOptional("localFrameSize", MFI.LocalFrameSize, (unsigned)0);
479  YamlIO.mapOptional("savePoint", MFI.SavePoint,
480  StringValue()); // Don't print it out when it's empty.
481  YamlIO.mapOptional("restorePoint", MFI.RestorePoint,
482  StringValue()); // Don't print it out when it's empty.
483  }
484 };
485 
486 /// Targets should override this in a way that mirrors the implementation of
487 /// llvm::MachineFunctionInfo.
489  virtual ~MachineFunctionInfo() {}
490  virtual void mappingImpl(IO &YamlIO) {}
491 };
492 
493 template <> struct MappingTraits<std::unique_ptr<MachineFunctionInfo>> {
494  static void mapping(IO &YamlIO, std::unique_ptr<MachineFunctionInfo> &MFI) {
495  if (MFI)
496  MFI->mappingImpl(YamlIO);
497  }
498 };
499 
502  unsigned Alignment = 0;
503  bool ExposesReturnsTwice = false;
504  // GISel MachineFunctionProperties.
505  bool Legalized = false;
506  bool RegBankSelected = false;
507  bool Selected = false;
508  bool FailedISel = false;
509  // Register information
510  bool TracksRegLiveness = false;
511  bool HasWinCFI = false;
512  std::vector<VirtualRegisterDefinition> VirtualRegisters;
513  std::vector<MachineFunctionLiveIn> LiveIns;
515  // TODO: Serialize the various register masks.
516  // Frame information
518  std::vector<FixedMachineStackObject> FixedStackObjects;
519  std::vector<MachineStackObject> StackObjects;
520  std::vector<MachineConstantPoolValue> Constants; /// Constant pool.
521  std::unique_ptr<MachineFunctionInfo> MachineFuncInfo;
524 };
525 
526 template <> struct MappingTraits<MachineFunction> {
527  static void mapping(IO &YamlIO, MachineFunction &MF) {
528  YamlIO.mapRequired("name", MF.Name);
529  YamlIO.mapOptional("alignment", MF.Alignment, (unsigned)0);
530  YamlIO.mapOptional("exposesReturnsTwice", MF.ExposesReturnsTwice, false);
531  YamlIO.mapOptional("legalized", MF.Legalized, false);
532  YamlIO.mapOptional("regBankSelected", MF.RegBankSelected, false);
533  YamlIO.mapOptional("selected", MF.Selected, false);
534  YamlIO.mapOptional("failedISel", MF.FailedISel, false);
535  YamlIO.mapOptional("tracksRegLiveness", MF.TracksRegLiveness, false);
536  YamlIO.mapOptional("hasWinCFI", MF.HasWinCFI, false);
537  YamlIO.mapOptional("registers", MF.VirtualRegisters,
538  std::vector<VirtualRegisterDefinition>());
539  YamlIO.mapOptional("liveins", MF.LiveIns,
540  std::vector<MachineFunctionLiveIn>());
541  YamlIO.mapOptional("calleeSavedRegisters", MF.CalleeSavedRegisters,
542  Optional<std::vector<FlowStringValue>>());
543  YamlIO.mapOptional("frameInfo", MF.FrameInfo, MachineFrameInfo());
544  YamlIO.mapOptional("fixedStack", MF.FixedStackObjects,
545  std::vector<FixedMachineStackObject>());
546  YamlIO.mapOptional("stack", MF.StackObjects,
547  std::vector<MachineStackObject>());
548  YamlIO.mapOptional("constants", MF.Constants,
549  std::vector<MachineConstantPoolValue>());
550  YamlIO.mapOptional("machineFunctionInfo", MF.MachineFuncInfo);
551  if (!YamlIO.outputting() || !MF.JumpTableInfo.Entries.empty())
552  YamlIO.mapOptional("jumpTable", MF.JumpTableInfo, MachineJumpTable());
553  YamlIO.mapOptional("body", MF.Body, BlockStringValue());
554  }
555 };
556 
557 } // end namespace yaml
558 } // end namespace llvm
559 
560 #endif // LLVM_CODEGEN_MIRYAMLMAPPING_H
Represents a range in source code.
Definition: SMLoc.h:48
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:218
StringValue(const char Val[])
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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
static QuotingType mustQuote(StringRef S)
unsigned Reg
EK_Inline - Jump table entries are emitted inline at their point of use.
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)
static void mapping(yaml::IO &YamlIO, FixedMachineStackObject &Object)
JTEntryKind
JTEntryKind - This enum indicates how each entry of the jump table is represented and emitted...
Definition: BitVector.h:937
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
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...
Definition: Type.h:45
This is an important base class in LLVM.
Definition: Constant.h:41
static void mapping(IO &YamlIO, MachineFunctionLiveIn &LiveIn)
MachineJumpTable JumpTableInfo
static void mapping(IO &YamlIO, std::unique_ptr< MachineFunctionInfo > &MFI)
unsigned MaxCallFrameSize
~0u means: not computed yet.
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)
static StringRef input(StringRef Scalar, void *Ctx, BlockStringValue &S)
Optional< int64_t > LocalOffset
static void mapping(IO &YamlIO, MachineFrameInfo &MFI)
static void mapping(IO &YamlIO, VirtualRegisterDefinition &Reg)
A wrapper around std::string which contains a source range that&#39;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&#39;s being set during parsing.
std::vector< Entry > Entries
static void mapping(IO &YamlIO, MachineJumpTable &JT)
static QuotingType mustQuote(StringRef S)
std::vector< MachineConstantPoolValue > Constants
uint32_t Size
Definition: Profile.cpp:46
bool operator==(const BlockStringValue &Other) const
bool operator==(const FixedMachineStackObject &Other) const
static void output(const StringValue &S, void *, raw_ostream &OS)
std::vector< FixedMachineStackObject > FixedStackObjects
LLVM Value Representation.
Definition: Value.h:72
bool operator==(const MachineJumpTable &Other) const
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
UnsignedValue(unsigned Value)
EK_GPRel32BlockAddress - Each entry is an address of block, encoded with a relocation as gp-relative...
MachineJumpTableInfo::JTEntryKind Kind
static void output(const BlockStringValue &S, void *Ctx, raw_ostream &OS)
bool operator==(const VirtualRegisterDefinition &Other) const
bool operator==(const MachineFunctionLiveIn &Other) const
SMRange getSourceRange() const
Definition: YAMLParser.h:159
Abstract base class for all Nodes.
Definition: YAMLParser.h:113