LLVM  13.0.0git
Record.h
Go to the documentation of this file.
1 //===- llvm/TableGen/Record.h - Classes for Table Records -------*- 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 defines the main TableGen data structures, including the TableGen
10 // types, values, and high-level data structures.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TABLEGEN_RECORD_H
15 #define LLVM_TABLEGEN_RECORD_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/DenseSet.h"
20 #include "llvm/ADT/FoldingSet.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/ADT/StringExtras.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/Support/Casting.h"
27 #include "llvm/Support/SMLoc.h"
28 #include "llvm/Support/Timer.h"
31 #include <algorithm>
32 #include <cassert>
33 #include <cstddef>
34 #include <cstdint>
35 #include <map>
36 #include <memory>
37 #include <string>
38 #include <utility>
39 #include <vector>
40 
41 namespace llvm {
42 
43 class ListRecTy;
44 struct MultiClass;
45 class Record;
46 class RecordKeeper;
47 class RecordVal;
48 class Resolver;
49 class StringInit;
50 class TypedInit;
51 
52 //===----------------------------------------------------------------------===//
53 // Type Classes
54 //===----------------------------------------------------------------------===//
55 
56 class RecTy {
57 public:
58  /// Subclass discriminator (for dyn_cast<> et al.)
59  enum RecTyKind {
67  };
68 
69 private:
70  RecTyKind Kind;
71  /// ListRecTy of the list that has elements of this type.
72  ListRecTy *ListTy = nullptr;
73 
74 public:
75  RecTy(RecTyKind K) : Kind(K) {}
76  virtual ~RecTy() = default;
77 
78  RecTyKind getRecTyKind() const { return Kind; }
79 
80  virtual std::string getAsString() const = 0;
81  void print(raw_ostream &OS) const { OS << getAsString(); }
82  void dump() const;
83 
84  /// Return true if all values of 'this' type can be converted to the specified
85  /// type.
86  virtual bool typeIsConvertibleTo(const RecTy *RHS) const;
87 
88  /// Return true if 'this' type is equal to or a subtype of RHS. For example,
89  /// a bit set is not an int, but they are convertible.
90  virtual bool typeIsA(const RecTy *RHS) const;
91 
92  /// Returns the type representing list<thistype>.
94 };
95 
96 inline raw_ostream &operator<<(raw_ostream &OS, const RecTy &Ty) {
97  Ty.print(OS);
98  return OS;
99 }
100 
101 /// 'bit' - Represent a single bit
102 class BitRecTy : public RecTy {
103  static BitRecTy Shared;
104 
105  BitRecTy() : RecTy(BitRecTyKind) {}
106 
107 public:
108  static bool classof(const RecTy *RT) {
109  return RT->getRecTyKind() == BitRecTyKind;
110  }
111 
112  static BitRecTy *get() { return &Shared; }
113 
114  std::string getAsString() const override { return "bit"; }
115 
116  bool typeIsConvertibleTo(const RecTy *RHS) const override;
117 };
118 
119 /// 'bits<n>' - Represent a fixed number of bits
120 class BitsRecTy : public RecTy {
121  unsigned Size;
122 
123  explicit BitsRecTy(unsigned Sz) : RecTy(BitsRecTyKind), Size(Sz) {}
124 
125 public:
126  static bool classof(const RecTy *RT) {
127  return RT->getRecTyKind() == BitsRecTyKind;
128  }
129 
130  static BitsRecTy *get(unsigned Sz);
131 
132  unsigned getNumBits() const { return Size; }
133 
134  std::string getAsString() const override;
135 
136  bool typeIsConvertibleTo(const RecTy *RHS) const override;
137 
138  bool typeIsA(const RecTy *RHS) const override;
139 };
140 
141 /// 'int' - Represent an integer value of no particular size
142 class IntRecTy : public RecTy {
143  static IntRecTy Shared;
144 
145  IntRecTy() : RecTy(IntRecTyKind) {}
146 
147 public:
148  static bool classof(const RecTy *RT) {
149  return RT->getRecTyKind() == IntRecTyKind;
150  }
151 
152  static IntRecTy *get() { return &Shared; }
153 
154  std::string getAsString() const override { return "int"; }
155 
156  bool typeIsConvertibleTo(const RecTy *RHS) const override;
157 };
158 
159 /// 'string' - Represent an string value
160 class StringRecTy : public RecTy {
161  static StringRecTy Shared;
162 
164 
165 public:
166  static bool classof(const RecTy *RT) {
167  return RT->getRecTyKind() == StringRecTyKind;
168  }
169 
170  static StringRecTy *get() { return &Shared; }
171 
172  std::string getAsString() const override;
173 
174  bool typeIsConvertibleTo(const RecTy *RHS) const override;
175 };
176 
177 /// 'list<Ty>' - Represent a list of element values, all of which must be of
178 /// the specified type. The type is stored in ElementTy.
179 class ListRecTy : public RecTy {
180  friend ListRecTy *RecTy::getListTy();
181 
182  RecTy *ElementTy;
183 
184  explicit ListRecTy(RecTy *T) : RecTy(ListRecTyKind), ElementTy(T) {}
185 
186 public:
187  static bool classof(const RecTy *RT) {
188  return RT->getRecTyKind() == ListRecTyKind;
189  }
190 
191  static ListRecTy *get(RecTy *T) { return T->getListTy(); }
192  RecTy *getElementType() const { return ElementTy; }
193 
194  std::string getAsString() const override;
195 
196  bool typeIsConvertibleTo(const RecTy *RHS) const override;
197 
198  bool typeIsA(const RecTy *RHS) const override;
199 };
200 
201 /// 'dag' - Represent a dag fragment
202 class DagRecTy : public RecTy {
203  static DagRecTy Shared;
204 
205  DagRecTy() : RecTy(DagRecTyKind) {}
206 
207 public:
208  static bool classof(const RecTy *RT) {
209  return RT->getRecTyKind() == DagRecTyKind;
210  }
211 
212  static DagRecTy *get() { return &Shared; }
213 
214  std::string getAsString() const override;
215 };
216 
217 /// '[classname]' - Type of record values that have zero or more superclasses.
218 ///
219 /// The list of superclasses is non-redundant, i.e. only contains classes that
220 /// are not the superclass of some other listed class.
221 class RecordRecTy final : public RecTy, public FoldingSetNode,
222  public TrailingObjects<RecordRecTy, Record *> {
223  friend class Record;
224 
225  unsigned NumClasses;
226 
227  explicit RecordRecTy(unsigned Num)
228  : RecTy(RecordRecTyKind), NumClasses(Num) {}
229 
230 public:
231  RecordRecTy(const RecordRecTy &) = delete;
232  RecordRecTy &operator=(const RecordRecTy &) = delete;
233 
234  // Do not use sized deallocation due to trailing objects.
235  void operator delete(void *p) { ::operator delete(p); }
236 
237  static bool classof(const RecTy *RT) {
238  return RT->getRecTyKind() == RecordRecTyKind;
239  }
240 
241  /// Get the record type with the given non-redundant list of superclasses.
242  static RecordRecTy *get(ArrayRef<Record *> Classes);
243 
244  void Profile(FoldingSetNodeID &ID) const;
245 
247  return makeArrayRef(getTrailingObjects<Record *>(), NumClasses);
248  }
249 
250  using const_record_iterator = Record * const *;
251 
252  const_record_iterator classes_begin() const { return getClasses().begin(); }
253  const_record_iterator classes_end() const { return getClasses().end(); }
254 
255  std::string getAsString() const override;
256 
257  bool isSubClassOf(Record *Class) const;
258  bool typeIsConvertibleTo(const RecTy *RHS) const override;
259 
260  bool typeIsA(const RecTy *RHS) const override;
261 };
262 
263 /// Find a common type that T1 and T2 convert to.
264 /// Return 0 if no such type exists.
265 RecTy *resolveTypes(RecTy *T1, RecTy *T2);
266 
267 //===----------------------------------------------------------------------===//
268 // Initializer Classes
269 //===----------------------------------------------------------------------===//
270 
271 class Init {
272 protected:
273  /// Discriminator enum (for isa<>, dyn_cast<>, et al.)
274  ///
275  /// This enum is laid out by a preorder traversal of the inheritance
276  /// hierarchy, and does not contain an entry for abstract classes, as per
277  /// the recommendation in docs/HowToSetUpLLVMStyleRTTI.rst.
278  ///
279  /// We also explicitly include "first" and "last" values for each
280  /// interior node of the inheritance tree, to make it easier to read the
281  /// corresponding classof().
282  ///
283  /// We could pack these a bit tighter by not having the IK_FirstXXXInit
284  /// and IK_LastXXXInit be their own values, but that would degrade
285  /// readability for really no benefit.
286  enum InitKind : uint8_t {
287  IK_First, // unused; silence a spurious warning
312  };
313 
314 private:
315  const InitKind Kind;
316 
317 protected:
318  uint8_t Opc; // Used by UnOpInit, BinOpInit, and TernOpInit
319 
320 private:
321  virtual void anchor();
322 
323 public:
324  /// Get the kind (type) of the value.
325  InitKind getKind() const { return Kind; }
326 
327 protected:
328  explicit Init(InitKind K, uint8_t Opc = 0) : Kind(K), Opc(Opc) {}
329 
330 public:
331  Init(const Init &) = delete;
332  Init &operator=(const Init &) = delete;
333  virtual ~Init() = default;
334 
335  /// Is this a complete value with no unset (uninitialized) subvalues?
336  virtual bool isComplete() const { return true; }
337 
338  /// Is this a concrete and fully resolved value without any references or
339  /// stuck operations? Unset values are concrete.
340  virtual bool isConcrete() const { return false; }
341 
342  /// Print this value.
343  void print(raw_ostream &OS) const { OS << getAsString(); }
344 
345  /// Convert this value to a literal form.
346  virtual std::string getAsString() const = 0;
347 
348  /// Convert this value to a literal form,
349  /// without adding quotes around a string.
350  virtual std::string getAsUnquotedString() const { return getAsString(); }
351 
352  /// Debugging method that may be called through a debugger; just
353  /// invokes print on stderr.
354  void dump() const;
355 
356  /// If this value is convertible to type \p Ty, return a value whose
357  /// type is \p Ty, generating a !cast operation if required.
358  /// Otherwise, return null.
359  virtual Init *getCastTo(RecTy *Ty) const = 0;
360 
361  /// Convert to a value whose type is \p Ty, or return null if this
362  /// is not possible. This can happen if the value's type is convertible
363  /// to \p Ty, but there are unresolved references.
364  virtual Init *convertInitializerTo(RecTy *Ty) const = 0;
365 
366  /// This function is used to implement the bit range
367  /// selection operator. Given a value, it selects the specified bits,
368  /// returning them as a new \p Init of type \p bits. If it is not legal
369  /// to use the bit selection operator on this value, null is returned.
371  return nullptr;
372  }
373 
374  /// This function is used to implement the list slice
375  /// selection operator. Given a value, it selects the specified list
376  /// elements, returning them as a new \p Init of type \p list. If it
377  /// is not legal to use the slice operator, null is returned.
378  virtual Init *convertInitListSlice(ArrayRef<unsigned> Elements) const {
379  return nullptr;
380  }
381 
382  /// This function is used to implement the FieldInit class.
383  /// Implementors of this method should return the type of the named
384  /// field if they are of type record.
385  virtual RecTy *getFieldType(StringInit *FieldName) const {
386  return nullptr;
387  }
388 
389  /// This function is used by classes that refer to other
390  /// variables which may not be defined at the time the expression is formed.
391  /// If a value is set for the variable later, this method will be called on
392  /// users of the value to allow the value to propagate out.
393  virtual Init *resolveReferences(Resolver &R) const {
394  return const_cast<Init *>(this);
395  }
396 
397  /// Get the \p Init value of the specified bit.
398  virtual Init *getBit(unsigned Bit) const = 0;
399 };
400 
401 inline raw_ostream &operator<<(raw_ostream &OS, const Init &I) {
402  I.print(OS); return OS;
403 }
404 
405 /// This is the common superclass of types that have a specific,
406 /// explicit type, stored in ValueTy.
407 class TypedInit : public Init {
408  RecTy *ValueTy;
409 
410 protected:
411  explicit TypedInit(InitKind K, RecTy *T, uint8_t Opc = 0)
412  : Init(K, Opc), ValueTy(T) {}
413 
414 public:
415  TypedInit(const TypedInit &) = delete;
416  TypedInit &operator=(const TypedInit &) = delete;
417 
418  static bool classof(const Init *I) {
419  return I->getKind() >= IK_FirstTypedInit &&
420  I->getKind() <= IK_LastTypedInit;
421  }
422 
423  /// Get the type of the Init as a RecTy.
424  RecTy *getType() const { return ValueTy; }
425 
426  Init *getCastTo(RecTy *Ty) const override;
427  Init *convertInitializerTo(RecTy *Ty) const override;
428 
430  Init *convertInitListSlice(ArrayRef<unsigned> Elements) const override;
431 
432  /// This method is used to implement the FieldInit class.
433  /// Implementors of this method should return the type of the named field if
434  /// they are of type record.
435  RecTy *getFieldType(StringInit *FieldName) const override;
436 };
437 
438 /// '?' - Represents an uninitialized value.
439 class UnsetInit : public Init {
440  UnsetInit() : Init(IK_UnsetInit) {}
441 
442 public:
443  UnsetInit(const UnsetInit &) = delete;
444  UnsetInit &operator=(const UnsetInit &) = delete;
445 
446  static bool classof(const Init *I) {
447  return I->getKind() == IK_UnsetInit;
448  }
449 
450  /// Get the singleton unset Init.
451  static UnsetInit *get();
452 
453  Init *getCastTo(RecTy *Ty) const override;
454  Init *convertInitializerTo(RecTy *Ty) const override;
455 
456  Init *getBit(unsigned Bit) const override {
457  return const_cast<UnsetInit*>(this);
458  }
459 
460  /// Is this a complete value with no unset (uninitialized) subvalues?
461  bool isComplete() const override { return false; }
462 
463  bool isConcrete() const override { return true; }
464 
465  /// Get the string representation of the Init.
466  std::string getAsString() const override { return "?"; }
467 };
468 
469 /// 'true'/'false' - Represent a concrete initializer for a bit.
470 class BitInit final : public TypedInit {
471  bool Value;
472 
473  explicit BitInit(bool V) : TypedInit(IK_BitInit, BitRecTy::get()), Value(V) {}
474 
475 public:
476  BitInit(const BitInit &) = delete;
477  BitInit &operator=(BitInit &) = delete;
478 
479  static bool classof(const Init *I) {
480  return I->getKind() == IK_BitInit;
481  }
482 
483  static BitInit *get(bool V);
484 
485  bool getValue() const { return Value; }
486 
487  Init *convertInitializerTo(RecTy *Ty) const override;
488 
489  Init *getBit(unsigned Bit) const override {
490  assert(Bit < 1 && "Bit index out of range!");
491  return const_cast<BitInit*>(this);
492  }
493 
494  bool isConcrete() const override { return true; }
495  std::string getAsString() const override { return Value ? "1" : "0"; }
496 };
497 
498 /// '{ a, b, c }' - Represents an initializer for a BitsRecTy value.
499 /// It contains a vector of bits, whose size is determined by the type.
500 class BitsInit final : public TypedInit, public FoldingSetNode,
501  public TrailingObjects<BitsInit, Init *> {
502  unsigned NumBits;
503 
504  BitsInit(unsigned N)
505  : TypedInit(IK_BitsInit, BitsRecTy::get(N)), NumBits(N) {}
506 
507 public:
508  BitsInit(const BitsInit &) = delete;
509  BitsInit &operator=(const BitsInit &) = delete;
510 
511  // Do not use sized deallocation due to trailing objects.
512  void operator delete(void *p) { ::operator delete(p); }
513 
514  static bool classof(const Init *I) {
515  return I->getKind() == IK_BitsInit;
516  }
517 
518  static BitsInit *get(ArrayRef<Init *> Range);
519 
520  void Profile(FoldingSetNodeID &ID) const;
521 
522  unsigned getNumBits() const { return NumBits; }
523 
524  Init *convertInitializerTo(RecTy *Ty) const override;
526 
527  bool isComplete() const override {
528  for (unsigned i = 0; i != getNumBits(); ++i)
529  if (!getBit(i)->isComplete()) return false;
530  return true;
531  }
532 
533  bool allInComplete() const {
534  for (unsigned i = 0; i != getNumBits(); ++i)
535  if (getBit(i)->isComplete()) return false;
536  return true;
537  }
538 
539  bool isConcrete() const override;
540  std::string getAsString() const override;
541 
542  Init *resolveReferences(Resolver &R) const override;
543 
544  Init *getBit(unsigned Bit) const override {
545  assert(Bit < NumBits && "Bit index out of range!");
546  return getTrailingObjects<Init *>()[Bit];
547  }
548 };
549 
550 /// '7' - Represent an initialization by a literal integer value.
551 class IntInit : public TypedInit {
552  int64_t Value;
553 
554  explicit IntInit(int64_t V)
556 
557 public:
558  IntInit(const IntInit &) = delete;
559  IntInit &operator=(const IntInit &) = delete;
560 
561  static bool classof(const Init *I) {
562  return I->getKind() == IK_IntInit;
563  }
564 
565  static IntInit *get(int64_t V);
566 
567  int64_t getValue() const { return Value; }
568 
569  Init *convertInitializerTo(RecTy *Ty) const override;
571 
572  bool isConcrete() const override { return true; }
573  std::string getAsString() const override;
574 
575  Init *getBit(unsigned Bit) const override {
576  return BitInit::get((Value & (1ULL << Bit)) != 0);
577  }
578 };
579 
580 /// "anonymous_n" - Represent an anonymous record name
581 class AnonymousNameInit : public TypedInit {
582  unsigned Value;
583 
584  explicit AnonymousNameInit(unsigned V)
586 
587 public:
588  AnonymousNameInit(const AnonymousNameInit &) = delete;
589  AnonymousNameInit &operator=(const AnonymousNameInit &) = delete;
590 
591  static bool classof(const Init *I) {
592  return I->getKind() == IK_AnonymousNameInit;
593  }
594 
595  static AnonymousNameInit *get(unsigned);
596 
597  unsigned getValue() const { return Value; }
598 
599  StringInit *getNameInit() const;
600 
601  std::string getAsString() const override;
602 
603  Init *resolveReferences(Resolver &R) const override;
604 
605  Init *getBit(unsigned Bit) const override {
606  llvm_unreachable("Illegal bit reference off string");
607  }
608 };
609 
610 /// "foo" - Represent an initialization by a string value.
611 class StringInit : public TypedInit {
612 public:
614  SF_String, // Format as "text"
615  SF_Code, // Format as [{text}]
616  };
617 
618 private:
620  StringFormat Format;
621 
622  explicit StringInit(StringRef V, StringFormat Fmt)
623  : TypedInit(IK_StringInit, StringRecTy::get()), Value(V), Format(Fmt) {}
624 
625 public:
626  StringInit(const StringInit &) = delete;
627  StringInit &operator=(const StringInit &) = delete;
628 
629  static bool classof(const Init *I) {
630  return I->getKind() == IK_StringInit;
631  }
632 
634 
636  return (Fmt1 == SF_Code || Fmt2 == SF_Code) ? SF_Code : SF_String;
637  }
638 
639  StringRef getValue() const { return Value; }
640  StringFormat getFormat() const { return Format; }
641  bool hasCodeFormat() const { return Format == SF_Code; }
642 
643  Init *convertInitializerTo(RecTy *Ty) const override;
644 
645  bool isConcrete() const override { return true; }
646 
647  std::string getAsString() const override {
648  if (Format == SF_String)
649  return "\"" + Value.str() + "\"";
650  else
651  return "[{" + Value.str() + "}]";
652  }
653 
654  std::string getAsUnquotedString() const override {
655  return std::string(Value);
656  }
657 
658  Init *getBit(unsigned Bit) const override {
659  llvm_unreachable("Illegal bit reference off string");
660  }
661 };
662 
663 /// [AL, AH, CL] - Represent a list of defs
664 ///
665 class ListInit final : public TypedInit, public FoldingSetNode,
666  public TrailingObjects<ListInit, Init *> {
667  unsigned NumValues;
668 
669 public:
670  using const_iterator = Init *const *;
671 
672 private:
673  explicit ListInit(unsigned N, RecTy *EltTy)
674  : TypedInit(IK_ListInit, ListRecTy::get(EltTy)), NumValues(N) {}
675 
676 public:
677  ListInit(const ListInit &) = delete;
678  ListInit &operator=(const ListInit &) = delete;
679 
680  // Do not use sized deallocation due to trailing objects.
681  void operator delete(void *p) { ::operator delete(p); }
682 
683  static bool classof(const Init *I) {
684  return I->getKind() == IK_ListInit;
685  }
686  static ListInit *get(ArrayRef<Init *> Range, RecTy *EltTy);
687 
688  void Profile(FoldingSetNodeID &ID) const;
689 
690  Init *getElement(unsigned i) const {
691  assert(i < NumValues && "List element index out of range!");
692  return getTrailingObjects<Init *>()[i];
693  }
695  return cast<ListRecTy>(getType())->getElementType();
696  }
697 
698  Record *getElementAsRecord(unsigned i) const;
699 
700  Init *convertInitListSlice(ArrayRef<unsigned> Elements) const override;
701 
702  Init *convertInitializerTo(RecTy *Ty) const override;
703 
704  /// This method is used by classes that refer to other
705  /// variables which may not be defined at the time they expression is formed.
706  /// If a value is set for the variable later, this method will be called on
707  /// users of the value to allow the value to propagate out.
708  ///
709  Init *resolveReferences(Resolver &R) const override;
710 
711  bool isComplete() const override;
712  bool isConcrete() const override;
713  std::string getAsString() const override;
714 
716  return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
717  }
718 
719  const_iterator begin() const { return getTrailingObjects<Init *>(); }
720  const_iterator end () const { return begin() + NumValues; }
721 
722  size_t size () const { return NumValues; }
723  bool empty() const { return NumValues == 0; }
724 
725  Init *getBit(unsigned Bit) const override {
726  llvm_unreachable("Illegal bit reference off list");
727  }
728 };
729 
730 /// Base class for operators
731 ///
732 class OpInit : public TypedInit {
733 protected:
734  explicit OpInit(InitKind K, RecTy *Type, uint8_t Opc)
735  : TypedInit(K, Type, Opc) {}
736 
737 public:
738  OpInit(const OpInit &) = delete;
739  OpInit &operator=(OpInit &) = delete;
740 
741  static bool classof(const Init *I) {
742  return I->getKind() >= IK_FirstOpInit &&
743  I->getKind() <= IK_LastOpInit;
744  }
745 
746  // Clone - Clone this operator, replacing arguments with the new list
747  virtual OpInit *clone(ArrayRef<Init *> Operands) const = 0;
748 
749  virtual unsigned getNumOperands() const = 0;
750  virtual Init *getOperand(unsigned i) const = 0;
751 
752  Init *getBit(unsigned Bit) const override;
753 };
754 
755 /// !op (X) - Transform an init.
756 ///
757 class UnOpInit : public OpInit, public FoldingSetNode {
758 public:
759  enum UnaryOp : uint8_t { CAST, NOT, HEAD, TAIL, SIZE, EMPTY, GETDAGOP };
760 
761 private:
762  Init *LHS;
763 
764  UnOpInit(UnaryOp opc, Init *lhs, RecTy *Type)
765  : OpInit(IK_UnOpInit, Type, opc), LHS(lhs) {}
766 
767 public:
768  UnOpInit(const UnOpInit &) = delete;
769  UnOpInit &operator=(const UnOpInit &) = delete;
770 
771  static bool classof(const Init *I) {
772  return I->getKind() == IK_UnOpInit;
773  }
774 
775  static UnOpInit *get(UnaryOp opc, Init *lhs, RecTy *Type);
776 
777  void Profile(FoldingSetNodeID &ID) const;
778 
779  // Clone - Clone this operator, replacing arguments with the new list
781  assert(Operands.size() == 1 &&
782  "Wrong number of operands for unary operation");
783  return UnOpInit::get(getOpcode(), *Operands.begin(), getType());
784  }
785 
786  unsigned getNumOperands() const override { return 1; }
787 
788  Init *getOperand(unsigned i) const override {
789  assert(i == 0 && "Invalid operand id for unary operator");
790  return getOperand();
791  }
792 
793  UnaryOp getOpcode() const { return (UnaryOp)Opc; }
794  Init *getOperand() const { return LHS; }
795 
796  // Fold - If possible, fold this to a simpler init. Return this if not
797  // possible to fold.
798  Init *Fold(Record *CurRec, bool IsFinal = false) const;
799 
800  Init *resolveReferences(Resolver &R) const override;
801 
802  std::string getAsString() const override;
803 };
804 
805 /// !op (X, Y) - Combine two inits.
806 class BinOpInit : public OpInit, public FoldingSetNode {
807 public:
808  enum BinaryOp : uint8_t { ADD, SUB, MUL, AND, OR, XOR, SHL, SRA, SRL, LISTCONCAT,
810  NE, LE, LT, GE, GT, SETDAGOP };
811 
812 private:
813  Init *LHS, *RHS;
814 
815  BinOpInit(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type) :
816  OpInit(IK_BinOpInit, Type, opc), LHS(lhs), RHS(rhs) {}
817 
818 public:
819  BinOpInit(const BinOpInit &) = delete;
820  BinOpInit &operator=(const BinOpInit &) = delete;
821 
822  static bool classof(const Init *I) {
823  return I->getKind() == IK_BinOpInit;
824  }
825 
826  static BinOpInit *get(BinaryOp opc, Init *lhs, Init *rhs,
827  RecTy *Type);
828  static Init *getStrConcat(Init *lhs, Init *rhs);
829  static Init *getListConcat(TypedInit *lhs, Init *rhs);
830 
831  void Profile(FoldingSetNodeID &ID) const;
832 
833  // Clone - Clone this operator, replacing arguments with the new list
835  assert(Operands.size() == 2 &&
836  "Wrong number of operands for binary operation");
837  return BinOpInit::get(getOpcode(), Operands[0], Operands[1], getType());
838  }
839 
840  unsigned getNumOperands() const override { return 2; }
841  Init *getOperand(unsigned i) const override {
842  switch (i) {
843  default: llvm_unreachable("Invalid operand id for binary operator");
844  case 0: return getLHS();
845  case 1: return getRHS();
846  }
847  }
848 
849  BinaryOp getOpcode() const { return (BinaryOp)Opc; }
850  Init *getLHS() const { return LHS; }
851  Init *getRHS() const { return RHS; }
852 
853  // Fold - If possible, fold this to a simpler init. Return this if not
854  // possible to fold.
855  Init *Fold(Record *CurRec) const;
856 
857  Init *resolveReferences(Resolver &R) const override;
858 
859  std::string getAsString() const override;
860 };
861 
862 /// !op (X, Y, Z) - Combine two inits.
863 class TernOpInit : public OpInit, public FoldingSetNode {
864 public:
865  enum TernaryOp : uint8_t { SUBST, FOREACH, FILTER, IF, DAG, SUBSTR, FIND };
866 
867 private:
868  Init *LHS, *MHS, *RHS;
869 
870  TernOpInit(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs,
871  RecTy *Type) :
872  OpInit(IK_TernOpInit, Type, opc), LHS(lhs), MHS(mhs), RHS(rhs) {}
873 
874 public:
875  TernOpInit(const TernOpInit &) = delete;
876  TernOpInit &operator=(const TernOpInit &) = delete;
877 
878  static bool classof(const Init *I) {
879  return I->getKind() == IK_TernOpInit;
880  }
881 
882  static TernOpInit *get(TernaryOp opc, Init *lhs,
883  Init *mhs, Init *rhs,
884  RecTy *Type);
885 
886  void Profile(FoldingSetNodeID &ID) const;
887 
888  // Clone - Clone this operator, replacing arguments with the new list
890  assert(Operands.size() == 3 &&
891  "Wrong number of operands for ternary operation");
892  return TernOpInit::get(getOpcode(), Operands[0], Operands[1], Operands[2],
893  getType());
894  }
895 
896  unsigned getNumOperands() const override { return 3; }
897  Init *getOperand(unsigned i) const override {
898  switch (i) {
899  default: llvm_unreachable("Invalid operand id for ternary operator");
900  case 0: return getLHS();
901  case 1: return getMHS();
902  case 2: return getRHS();
903  }
904  }
905 
906  TernaryOp getOpcode() const { return (TernaryOp)Opc; }
907  Init *getLHS() const { return LHS; }
908  Init *getMHS() const { return MHS; }
909  Init *getRHS() const { return RHS; }
910 
911  // Fold - If possible, fold this to a simpler init. Return this if not
912  // possible to fold.
913  Init *Fold(Record *CurRec) const;
914 
915  bool isComplete() const override {
916  return LHS->isComplete() && MHS->isComplete() && RHS->isComplete();
917  }
918 
919  Init *resolveReferences(Resolver &R) const override;
920 
921  std::string getAsString() const override;
922 };
923 
924 /// !cond(condition_1: value1, ... , condition_n: value)
925 /// Selects the first value for which condition is true.
926 /// Otherwise reports an error.
927 class CondOpInit final : public TypedInit, public FoldingSetNode,
928  public TrailingObjects<CondOpInit, Init *> {
929  unsigned NumConds;
930  RecTy *ValType;
931 
932  CondOpInit(unsigned NC, RecTy *Type)
934  NumConds(NC), ValType(Type) {}
935 
936  size_t numTrailingObjects(OverloadToken<Init *>) const {
937  return 2*NumConds;
938  }
939 
940 public:
941  CondOpInit(const CondOpInit &) = delete;
942  CondOpInit &operator=(const CondOpInit &) = delete;
943 
944  static bool classof(const Init *I) {
945  return I->getKind() == IK_CondOpInit;
946  }
947 
949  RecTy *Type);
950 
951  void Profile(FoldingSetNodeID &ID) const;
952 
953  RecTy *getValType() const { return ValType; }
954 
955  unsigned getNumConds() const { return NumConds; }
956 
957  Init *getCond(unsigned Num) const {
958  assert(Num < NumConds && "Condition number out of range!");
959  return getTrailingObjects<Init *>()[Num];
960  }
961 
962  Init *getVal(unsigned Num) const {
963  assert(Num < NumConds && "Val number out of range!");
964  return getTrailingObjects<Init *>()[Num+NumConds];
965  }
966 
968  return makeArrayRef(getTrailingObjects<Init *>(), NumConds);
969  }
970 
972  return makeArrayRef(getTrailingObjects<Init *>()+NumConds, NumConds);
973  }
974 
975  Init *Fold(Record *CurRec) const;
976 
977  Init *resolveReferences(Resolver &R) const override;
978 
979  bool isConcrete() const override;
980  bool isComplete() const override;
981  std::string getAsString() const override;
982 
985 
986  inline const_case_iterator arg_begin() const { return getConds().begin(); }
987  inline const_case_iterator arg_end () const { return getConds().end(); }
988 
989  inline size_t case_size () const { return NumConds; }
990  inline bool case_empty() const { return NumConds == 0; }
991 
992  inline const_val_iterator name_begin() const { return getVals().begin();}
993  inline const_val_iterator name_end () const { return getVals().end(); }
994 
995  inline size_t val_size () const { return NumConds; }
996  inline bool val_empty() const { return NumConds == 0; }
997 
998  Init *getBit(unsigned Bit) const override;
999 };
1000 
1001 /// !foldl (a, b, expr, start, lst) - Fold over a list.
1002 class FoldOpInit : public TypedInit, public FoldingSetNode {
1003 private:
1004  Init *Start;
1005  Init *List;
1006  Init *A;
1007  Init *B;
1008  Init *Expr;
1009 
1010  FoldOpInit(Init *Start, Init *List, Init *A, Init *B, Init *Expr, RecTy *Type)
1011  : TypedInit(IK_FoldOpInit, Type), Start(Start), List(List), A(A), B(B),
1012  Expr(Expr) {}
1013 
1014 public:
1015  FoldOpInit(const FoldOpInit &) = delete;
1016  FoldOpInit &operator=(const FoldOpInit &) = delete;
1017 
1018  static bool classof(const Init *I) { return I->getKind() == IK_FoldOpInit; }
1019 
1020  static FoldOpInit *get(Init *Start, Init *List, Init *A, Init *B, Init *Expr,
1021  RecTy *Type);
1022 
1023  void Profile(FoldingSetNodeID &ID) const;
1024 
1025  // Fold - If possible, fold this to a simpler init. Return this if not
1026  // possible to fold.
1027  Init *Fold(Record *CurRec) const;
1028 
1029  bool isComplete() const override { return false; }
1030 
1031  Init *resolveReferences(Resolver &R) const override;
1032 
1033  Init *getBit(unsigned Bit) const override;
1034 
1035  std::string getAsString() const override;
1036 };
1037 
1038 /// !isa<type>(expr) - Dynamically determine the type of an expression.
1039 class IsAOpInit : public TypedInit, public FoldingSetNode {
1040 private:
1041  RecTy *CheckType;
1042  Init *Expr;
1043 
1044  IsAOpInit(RecTy *CheckType, Init *Expr)
1045  : TypedInit(IK_IsAOpInit, IntRecTy::get()), CheckType(CheckType),
1046  Expr(Expr) {}
1047 
1048 public:
1049  IsAOpInit(const IsAOpInit &) = delete;
1050  IsAOpInit &operator=(const IsAOpInit &) = delete;
1051 
1052  static bool classof(const Init *I) { return I->getKind() == IK_IsAOpInit; }
1053 
1054  static IsAOpInit *get(RecTy *CheckType, Init *Expr);
1055 
1056  void Profile(FoldingSetNodeID &ID) const;
1057 
1058  // Fold - If possible, fold this to a simpler init. Return this if not
1059  // possible to fold.
1060  Init *Fold() const;
1061 
1062  bool isComplete() const override { return false; }
1063 
1064  Init *resolveReferences(Resolver &R) const override;
1065 
1066  Init *getBit(unsigned Bit) const override;
1067 
1068  std::string getAsString() const override;
1069 };
1070 
1071 /// 'Opcode' - Represent a reference to an entire variable object.
1072 class VarInit : public TypedInit {
1073  Init *VarName;
1074 
1075  explicit VarInit(Init *VN, RecTy *T)
1076  : TypedInit(IK_VarInit, T), VarName(VN) {}
1077 
1078 public:
1079  VarInit(const VarInit &) = delete;
1080  VarInit &operator=(const VarInit &) = delete;
1081 
1082  static bool classof(const Init *I) {
1083  return I->getKind() == IK_VarInit;
1084  }
1085 
1086  static VarInit *get(StringRef VN, RecTy *T);
1087  static VarInit *get(Init *VN, RecTy *T);
1088 
1089  StringRef getName() const;
1090  Init *getNameInit() const { return VarName; }
1091 
1092  std::string getNameInitAsString() const {
1093  return getNameInit()->getAsUnquotedString();
1094  }
1095 
1096  /// This method is used by classes that refer to other
1097  /// variables which may not be defined at the time they expression is formed.
1098  /// If a value is set for the variable later, this method will be called on
1099  /// users of the value to allow the value to propagate out.
1100  ///
1101  Init *resolveReferences(Resolver &R) const override;
1102 
1103  Init *getBit(unsigned Bit) const override;
1104 
1105  std::string getAsString() const override { return std::string(getName()); }
1106 };
1107 
1108 /// Opcode{0} - Represent access to one bit of a variable or field.
1109 class VarBitInit final : public TypedInit {
1110  TypedInit *TI;
1111  unsigned Bit;
1112 
1113  VarBitInit(TypedInit *T, unsigned B)
1114  : TypedInit(IK_VarBitInit, BitRecTy::get()), TI(T), Bit(B) {
1115  assert(T->getType() &&
1116  (isa<IntRecTy>(T->getType()) ||
1117  (isa<BitsRecTy>(T->getType()) &&
1118  cast<BitsRecTy>(T->getType())->getNumBits() > B)) &&
1119  "Illegal VarBitInit expression!");
1120  }
1121 
1122 public:
1123  VarBitInit(const VarBitInit &) = delete;
1124  VarBitInit &operator=(const VarBitInit &) = delete;
1125 
1126  static bool classof(const Init *I) {
1127  return I->getKind() == IK_VarBitInit;
1128  }
1129 
1130  static VarBitInit *get(TypedInit *T, unsigned B);
1131 
1132  Init *getBitVar() const { return TI; }
1133  unsigned getBitNum() const { return Bit; }
1134 
1135  std::string getAsString() const override;
1136  Init *resolveReferences(Resolver &R) const override;
1137 
1138  Init *getBit(unsigned B) const override {
1139  assert(B < 1 && "Bit index out of range!");
1140  return const_cast<VarBitInit*>(this);
1141  }
1142 };
1143 
1144 /// List[4] - Represent access to one element of a var or
1145 /// field.
1147  TypedInit *TI;
1148  unsigned Element;
1149 
1150  VarListElementInit(TypedInit *T, unsigned E)
1152  cast<ListRecTy>(T->getType())->getElementType()),
1153  TI(T), Element(E) {
1154  assert(T->getType() && isa<ListRecTy>(T->getType()) &&
1155  "Illegal VarBitInit expression!");
1156  }
1157 
1158 public:
1159  VarListElementInit(const VarListElementInit &) = delete;
1160  VarListElementInit &operator=(const VarListElementInit &) = delete;
1161 
1162  static bool classof(const Init *I) {
1163  return I->getKind() == IK_VarListElementInit;
1164  }
1165 
1166  static VarListElementInit *get(TypedInit *T, unsigned E);
1167 
1168  TypedInit *getVariable() const { return TI; }
1169  unsigned getElementNum() const { return Element; }
1170 
1171  std::string getAsString() const override;
1172  Init *resolveReferences(Resolver &R) const override;
1173 
1174  Init *getBit(unsigned Bit) const override;
1175 };
1176 
1177 /// AL - Represent a reference to a 'def' in the description
1178 class DefInit : public TypedInit {
1179  friend class Record;
1180 
1181  Record *Def;
1182 
1183  explicit DefInit(Record *D);
1184 
1185 public:
1186  DefInit(const DefInit &) = delete;
1187  DefInit &operator=(const DefInit &) = delete;
1188 
1189  static bool classof(const Init *I) {
1190  return I->getKind() == IK_DefInit;
1191  }
1192 
1193  static DefInit *get(Record*);
1194 
1195  Init *convertInitializerTo(RecTy *Ty) const override;
1196 
1197  Record *getDef() const { return Def; }
1198 
1199  //virtual Init *convertInitializerBitRange(ArrayRef<unsigned> Bits);
1200 
1201  RecTy *getFieldType(StringInit *FieldName) const override;
1202 
1203  bool isConcrete() const override { return true; }
1204  std::string getAsString() const override;
1205 
1206  Init *getBit(unsigned Bit) const override {
1207  llvm_unreachable("Illegal bit reference off def");
1208  }
1209 };
1210 
1211 /// classname<targs...> - Represent an uninstantiated anonymous class
1212 /// instantiation.
1213 class VarDefInit final : public TypedInit, public FoldingSetNode,
1214  public TrailingObjects<VarDefInit, Init *> {
1215  Record *Class;
1216  DefInit *Def = nullptr; // after instantiation
1217  unsigned NumArgs;
1218 
1219  explicit VarDefInit(Record *Class, unsigned N)
1220  : TypedInit(IK_VarDefInit, RecordRecTy::get(Class)), Class(Class), NumArgs(N) {}
1221 
1222  DefInit *instantiate();
1223 
1224 public:
1225  VarDefInit(const VarDefInit &) = delete;
1226  VarDefInit &operator=(const VarDefInit &) = delete;
1227 
1228  // Do not use sized deallocation due to trailing objects.
1229  void operator delete(void *p) { ::operator delete(p); }
1230 
1231  static bool classof(const Init *I) {
1232  return I->getKind() == IK_VarDefInit;
1233  }
1234  static VarDefInit *get(Record *Class, ArrayRef<Init *> Args);
1235 
1236  void Profile(FoldingSetNodeID &ID) const;
1237 
1238  Init *resolveReferences(Resolver &R) const override;
1239  Init *Fold() const;
1240 
1241  std::string getAsString() const override;
1242 
1243  Init *getArg(unsigned i) const {
1244  assert(i < NumArgs && "Argument index out of range!");
1245  return getTrailingObjects<Init *>()[i];
1246  }
1247 
1248  using const_iterator = Init *const *;
1249 
1250  const_iterator args_begin() const { return getTrailingObjects<Init *>(); }
1251  const_iterator args_end () const { return args_begin() + NumArgs; }
1252 
1253  size_t args_size () const { return NumArgs; }
1254  bool args_empty() const { return NumArgs == 0; }
1255 
1256  ArrayRef<Init *> args() const { return makeArrayRef(args_begin(), NumArgs); }
1257 
1258  Init *getBit(unsigned Bit) const override {
1259  llvm_unreachable("Illegal bit reference off anonymous def");
1260  }
1261 };
1262 
1263 /// X.Y - Represent a reference to a subfield of a variable
1264 class FieldInit : public TypedInit {
1265  Init *Rec; // Record we are referring to
1266  StringInit *FieldName; // Field we are accessing
1267 
1268  FieldInit(Init *R, StringInit *FN)
1269  : TypedInit(IK_FieldInit, R->getFieldType(FN)), Rec(R), FieldName(FN) {
1270 #ifndef NDEBUG
1271  if (!getType()) {
1272  llvm::errs() << "In Record = " << Rec->getAsString()
1273  << ", got FieldName = " << *FieldName
1274  << " with non-record type!\n";
1275  llvm_unreachable("FieldInit with non-record type!");
1276  }
1277 #endif
1278  }
1279 
1280 public:
1281  FieldInit(const FieldInit &) = delete;
1282  FieldInit &operator=(const FieldInit &) = delete;
1283 
1284  static bool classof(const Init *I) {
1285  return I->getKind() == IK_FieldInit;
1286  }
1287 
1288  static FieldInit *get(Init *R, StringInit *FN);
1289 
1290  Init *getRecord() const { return Rec; }
1291  StringInit *getFieldName() const { return FieldName; }
1292 
1293  Init *getBit(unsigned Bit) const override;
1294 
1295  Init *resolveReferences(Resolver &R) const override;
1296  Init *Fold(Record *CurRec) const;
1297 
1298  bool isConcrete() const override;
1299  std::string getAsString() const override {
1300  return Rec->getAsString() + "." + FieldName->getValue().str();
1301  }
1302 };
1303 
1304 /// (v a, b) - Represent a DAG tree value. DAG inits are required
1305 /// to have at least one value then a (possibly empty) list of arguments. Each
1306 /// argument can have a name associated with it.
1307 class DagInit final : public TypedInit, public FoldingSetNode,
1308  public TrailingObjects<DagInit, Init *, StringInit *> {
1309  friend TrailingObjects;
1310 
1311  Init *Val;
1312  StringInit *ValName;
1313  unsigned NumArgs;
1314  unsigned NumArgNames;
1315 
1316  DagInit(Init *V, StringInit *VN, unsigned NumArgs, unsigned NumArgNames)
1317  : TypedInit(IK_DagInit, DagRecTy::get()), Val(V), ValName(VN),
1318  NumArgs(NumArgs), NumArgNames(NumArgNames) {}
1319 
1320  size_t numTrailingObjects(OverloadToken<Init *>) const { return NumArgs; }
1321 
1322 public:
1323  DagInit(const DagInit &) = delete;
1324  DagInit &operator=(const DagInit &) = delete;
1325 
1326  static bool classof(const Init *I) {
1327  return I->getKind() == IK_DagInit;
1328  }
1329 
1330  static DagInit *get(Init *V, StringInit *VN, ArrayRef<Init *> ArgRange,
1331  ArrayRef<StringInit*> NameRange);
1332  static DagInit *get(Init *V, StringInit *VN,
1333  ArrayRef<std::pair<Init*, StringInit*>> Args);
1334 
1335  void Profile(FoldingSetNodeID &ID) const;
1336 
1337  Init *getOperator() const { return Val; }
1339 
1340  StringInit *getName() const { return ValName; }
1341 
1343  return ValName ? ValName->getValue() : StringRef();
1344  }
1345 
1346  unsigned getNumArgs() const { return NumArgs; }
1347 
1348  Init *getArg(unsigned Num) const {
1349  assert(Num < NumArgs && "Arg number out of range!");
1350  return getTrailingObjects<Init *>()[Num];
1351  }
1352 
1353  StringInit *getArgName(unsigned Num) const {
1354  assert(Num < NumArgNames && "Arg number out of range!");
1355  return getTrailingObjects<StringInit *>()[Num];
1356  }
1357 
1358  StringRef getArgNameStr(unsigned Num) const {
1359  StringInit *Init = getArgName(Num);
1360  return Init ? Init->getValue() : StringRef();
1361  }
1362 
1364  return makeArrayRef(getTrailingObjects<Init *>(), NumArgs);
1365  }
1366 
1368  return makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
1369  }
1370 
1371  Init *resolveReferences(Resolver &R) const override;
1372 
1373  bool isConcrete() const override;
1374  std::string getAsString() const override;
1375 
1378 
1379  inline const_arg_iterator arg_begin() const { return getArgs().begin(); }
1380  inline const_arg_iterator arg_end () const { return getArgs().end(); }
1381 
1382  inline size_t arg_size () const { return NumArgs; }
1383  inline bool arg_empty() const { return NumArgs == 0; }
1384 
1385  inline const_name_iterator name_begin() const { return getArgNames().begin();}
1386  inline const_name_iterator name_end () const { return getArgNames().end(); }
1387 
1388  inline size_t name_size () const { return NumArgNames; }
1389  inline bool name_empty() const { return NumArgNames == 0; }
1390 
1391  Init *getBit(unsigned Bit) const override {
1392  llvm_unreachable("Illegal bit reference off dag");
1393  }
1394 };
1395 
1396 //===----------------------------------------------------------------------===//
1397 // High-Level Classes
1398 //===----------------------------------------------------------------------===//
1399 
1400 /// This class represents a field in a record, including its name, type,
1401 /// value, and source location.
1402 class RecordVal {
1403  friend class Record;
1404 
1405 public:
1406  enum FieldKind {
1407  FK_Normal, // A normal record field.
1408  FK_NonconcreteOK, // A field that can be nonconcrete ('field' keyword).
1409  FK_TemplateArg, // A template argument.
1410  };
1411 
1412 private:
1413  Init *Name;
1414  SMLoc Loc; // Source location of definition of name.
1416  Init *Value;
1417 
1418 public:
1419  RecordVal(Init *N, RecTy *T, FieldKind K);
1420  RecordVal(Init *N, SMLoc Loc, RecTy *T, FieldKind K);
1421 
1422  /// Get the name of the field as a StringRef.
1423  StringRef getName() const;
1424 
1425  /// Get the name of the field as an Init.
1426  Init *getNameInit() const { return Name; }
1427 
1428  /// Get the name of the field as a std::string.
1429  std::string getNameInitAsString() const {
1430  return getNameInit()->getAsUnquotedString();
1431  }
1432 
1433  /// Get the source location of the point where the field was defined.
1434  const SMLoc &getLoc() const { return Loc; }
1435 
1436  /// Is this a field where nonconcrete values are okay?
1437  bool isNonconcreteOK() const {
1438  return TyAndKind.getInt() == FK_NonconcreteOK;
1439  }
1440 
1441  /// Is this a template argument?
1442  bool isTemplateArg() const {
1443  return TyAndKind.getInt() == FK_TemplateArg;
1444  }
1445 
1446  /// Get the type of the field value as a RecTy.
1447  RecTy *getType() const { return TyAndKind.getPointer(); }
1448 
1449  /// Get the type of the field for printing purposes.
1450  std::string getPrintType() const;
1451 
1452  /// Get the value of the field as an Init.
1453  Init *getValue() const { return Value; }
1454 
1455  /// Set the value of the field from an Init.
1456  bool setValue(Init *V);
1457 
1458  /// Set the value and source location of the field.
1459  bool setValue(Init *V, SMLoc NewLoc);
1460 
1461  void dump() const;
1462 
1463  /// Print the value to an output stream, possibly with a semicolon.
1464  void print(raw_ostream &OS, bool PrintSem = true) const;
1465 };
1466 
1467 inline raw_ostream &operator<<(raw_ostream &OS, const RecordVal &RV) {
1468  RV.print(OS << " ");
1469  return OS;
1470 }
1471 
1472 class Record {
1473 public:
1474  struct AssertionInfo {
1478 
1479  // User-defined constructor to support std::make_unique(). It can be
1480  // removed in C++20 when braced initialization is supported.
1483  };
1484 
1485 private:
1486  static unsigned LastID;
1487 
1488  Init *Name;
1489  // Location where record was instantiated, followed by the location of
1490  // multiclass prototypes used.
1491  SmallVector<SMLoc, 4> Locs;
1494  SmallVector<AssertionInfo, 0> Assertions;
1495 
1496  // All superclasses in the inheritance forest in post-order (yes, it
1497  // must be a forest; diamond-shaped inheritance is not allowed).
1499 
1500  // Tracks Record instances. Not owned by Record.
1501  RecordKeeper &TrackedRecords;
1502 
1503  // The DefInit corresponding to this record.
1504  DefInit *CorrespondingDefInit = nullptr;
1505 
1506  // Unique record ID.
1507  unsigned ID;
1508 
1509  bool IsAnonymous;
1510  bool IsClass;
1511 
1512  void checkName();
1513 
1514 public:
1515  // Constructs a record.
1516  explicit Record(Init *N, ArrayRef<SMLoc> locs, RecordKeeper &records,
1517  bool Anonymous = false, bool Class = false)
1518  : Name(N), Locs(locs.begin(), locs.end()), TrackedRecords(records),
1519  ID(LastID++), IsAnonymous(Anonymous), IsClass(Class) {
1520  checkName();
1521  }
1522 
1523  explicit Record(StringRef N, ArrayRef<SMLoc> locs, RecordKeeper &records,
1524  bool Class = false)
1525  : Record(StringInit::get(N), locs, records, false, Class) {}
1526 
1527  // When copy-constructing a Record, we must still guarantee a globally unique
1528  // ID number. Don't copy CorrespondingDefInit either, since it's owned by the
1529  // original record. All other fields can be copied normally.
1530  Record(const Record &O)
1531  : Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1532  Values(O.Values), Assertions(O.Assertions), SuperClasses(O.SuperClasses),
1533  TrackedRecords(O.TrackedRecords), ID(LastID++),
1534  IsAnonymous(O.IsAnonymous), IsClass(O.IsClass) { }
1535 
1536  static unsigned getNewUID() { return LastID++; }
1537 
1538  unsigned getID() const { return ID; }
1539 
1540  StringRef getName() const { return cast<StringInit>(Name)->getValue(); }
1541 
1542  Init *getNameInit() const {
1543  return Name;
1544  }
1545 
1546  const std::string getNameInitAsString() const {
1547  return getNameInit()->getAsUnquotedString();
1548  }
1549 
1550  void setName(Init *Name); // Also updates RecordKeeper.
1551 
1552  ArrayRef<SMLoc> getLoc() const { return Locs; }
1553  void appendLoc(SMLoc Loc) { Locs.push_back(Loc); }
1554 
1555  // Make the type that this record should have based on its superclasses.
1556  RecordRecTy *getType();
1557 
1558  /// get the corresponding DefInit.
1559  DefInit *getDefInit();
1560 
1561  bool isClass() const { return IsClass; }
1562 
1564  return TemplateArgs;
1565  }
1566 
1567  ArrayRef<RecordVal> getValues() const { return Values; }
1568 
1569  ArrayRef<AssertionInfo> getAssertions() const { return Assertions; }
1570 
1572  return SuperClasses;
1573  }
1574 
1575  /// Determine whether this record has the specified direct superclass.
1576  bool hasDirectSuperClass(const Record *SuperClass) const;
1577 
1578  /// Append the direct superclasses of this record to Classes.
1579  void getDirectSuperClasses(SmallVectorImpl<Record *> &Classes) const;
1580 
1581  bool isTemplateArg(Init *Name) const {
1582  return llvm::is_contained(TemplateArgs, Name);
1583  }
1584 
1585  const RecordVal *getValue(const Init *Name) const {
1586  for (const RecordVal &Val : Values)
1587  if (Val.Name == Name) return &Val;
1588  return nullptr;
1589  }
1590 
1591  const RecordVal *getValue(StringRef Name) const {
1592  return getValue(StringInit::get(Name));
1593  }
1594 
1595  RecordVal *getValue(const Init *Name) {
1596  return const_cast<RecordVal *>(static_cast<const Record *>(this)->getValue(Name));
1597  }
1598 
1600  return const_cast<RecordVal *>(static_cast<const Record *>(this)->getValue(Name));
1601  }
1602 
1603  void addTemplateArg(Init *Name) {
1604  assert(!isTemplateArg(Name) && "Template arg already defined!");
1605  TemplateArgs.push_back(Name);
1606  }
1607 
1608  void addValue(const RecordVal &RV) {
1609  assert(getValue(RV.getNameInit()) == nullptr && "Value already added!");
1610  Values.push_back(RV);
1611  }
1612 
1613  void removeValue(Init *Name) {
1614  for (unsigned i = 0, e = Values.size(); i != e; ++i)
1615  if (Values[i].getNameInit() == Name) {
1616  Values.erase(Values.begin()+i);
1617  return;
1618  }
1619  llvm_unreachable("Cannot remove an entry that does not exist!");
1620  }
1621 
1622  void removeValue(StringRef Name) {
1624  }
1625 
1626  void addAssertion(SMLoc Loc, Init *Condition, Init *Message) {
1627  Assertions.push_back(AssertionInfo(Loc, Condition, Message));
1628  }
1629 
1630  void appendAssertions(const Record *Rec) {
1631  Assertions.append(Rec->Assertions);
1632  }
1633 
1634  void checkRecordAssertions();
1635 
1636  bool isSubClassOf(const Record *R) const {
1637  for (const auto &SCPair : SuperClasses)
1638  if (SCPair.first == R)
1639  return true;
1640  return false;
1641  }
1642 
1643  bool isSubClassOf(StringRef Name) const {
1644  for (const auto &SCPair : SuperClasses) {
1645  if (const auto *SI = dyn_cast<StringInit>(SCPair.first->getNameInit())) {
1646  if (SI->getValue() == Name)
1647  return true;
1648  } else if (SCPair.first->getNameInitAsString() == Name) {
1649  return true;
1650  }
1651  }
1652  return false;
1653  }
1654 
1655  void addSuperClass(Record *R, SMRange Range) {
1656  assert(!CorrespondingDefInit &&
1657  "changing type of record after it has been referenced");
1658  assert(!isSubClassOf(R) && "Already subclassing record!");
1659  SuperClasses.push_back(std::make_pair(R, Range));
1660  }
1661 
1662  /// If there are any field references that refer to fields
1663  /// that have been filled in, we can propagate the values now.
1664  ///
1665  /// This is a final resolve: any error messages, e.g. due to undefined
1666  /// !cast references, are generated now.
1667  void resolveReferences(Init *NewName = nullptr);
1668 
1669  /// Apply the resolver to the name of the record as well as to the
1670  /// initializers of all fields of the record except SkipVal.
1671  ///
1672  /// The resolver should not resolve any of the fields itself, to avoid
1673  /// recursion / infinite loops.
1674  void resolveReferences(Resolver &R, const RecordVal *SkipVal = nullptr);
1675 
1677  return TrackedRecords;
1678  }
1679 
1680  bool isAnonymous() const {
1681  return IsAnonymous;
1682  }
1683 
1684  void dump() const;
1685 
1686  //===--------------------------------------------------------------------===//
1687  // High-level methods useful to tablegen back-ends
1688  //
1689 
1690  ///Return the source location for the named field.
1691  SMLoc getFieldLoc(StringRef FieldName) const;
1692 
1693  /// Return the initializer for a value with the specified name,
1694  /// or throw an exception if the field does not exist.
1695  Init *getValueInit(StringRef FieldName) const;
1696 
1697  /// Return true if the named field is unset.
1698  bool isValueUnset(StringRef FieldName) const {
1699  return isa<UnsetInit>(getValueInit(FieldName));
1700  }
1701 
1702  /// This method looks up the specified field and returns
1703  /// its value as a string, throwing an exception if the field does not exist
1704  /// or if the value is not a string.
1705  StringRef getValueAsString(StringRef FieldName) const;
1706 
1707  /// This method looks up the specified field and returns
1708  /// its value as a string, throwing an exception if the field if the value is
1709  /// not a string and llvm::Optional() if the field does not exist.
1711 
1712  /// This method looks up the specified field and returns
1713  /// its value as a BitsInit, throwing an exception if the field does not exist
1714  /// or if the value is not the right type.
1715  BitsInit *getValueAsBitsInit(StringRef FieldName) const;
1716 
1717  /// This method looks up the specified field and returns
1718  /// its value as a ListInit, throwing an exception if the field does not exist
1719  /// or if the value is not the right type.
1720  ListInit *getValueAsListInit(StringRef FieldName) const;
1721 
1722  /// This method looks up the specified field and
1723  /// returns its value as a vector of records, throwing an exception if the
1724  /// field does not exist or if the value is not the right type.
1725  std::vector<Record*> getValueAsListOfDefs(StringRef FieldName) const;
1726 
1727  /// This method looks up the specified field and
1728  /// returns its value as a vector of integers, throwing an exception if the
1729  /// field does not exist or if the value is not the right type.
1730  std::vector<int64_t> getValueAsListOfInts(StringRef FieldName) const;
1731 
1732  /// This method looks up the specified field and
1733  /// returns its value as a vector of strings, throwing an exception if the
1734  /// field does not exist or if the value is not the right type.
1735  std::vector<StringRef> getValueAsListOfStrings(StringRef FieldName) const;
1736 
1737  /// This method looks up the specified field and returns its
1738  /// value as a Record, throwing an exception if the field does not exist or if
1739  /// the value is not the right type.
1740  Record *getValueAsDef(StringRef FieldName) const;
1741 
1742  /// This method looks up the specified field and returns its value as a
1743  /// Record, returning null if the field exists but is "uninitialized"
1744  /// (i.e. set to `?`), and throwing an exception if the field does not
1745  /// exist or if its value is not the right type.
1746  Record *getValueAsOptionalDef(StringRef FieldName) const;
1747 
1748  /// This method looks up the specified field and returns its
1749  /// value as a bit, throwing an exception if the field does not exist or if
1750  /// the value is not the right type.
1751  bool getValueAsBit(StringRef FieldName) const;
1752 
1753  /// This method looks up the specified field and
1754  /// returns its value as a bit. If the field is unset, sets Unset to true and
1755  /// returns false.
1756  bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const;
1757 
1758  /// This method looks up the specified field and returns its
1759  /// value as an int64_t, throwing an exception if the field does not exist or
1760  /// if the value is not the right type.
1761  int64_t getValueAsInt(StringRef FieldName) const;
1762 
1763  /// This method looks up the specified field and returns its
1764  /// value as an Dag, throwing an exception if the field does not exist or if
1765  /// the value is not the right type.
1766  DagInit *getValueAsDag(StringRef FieldName) const;
1767 };
1768 
1769 raw_ostream &operator<<(raw_ostream &OS, const Record &R);
1770 
1772  friend class RecordRecTy;
1773 
1774  using RecordMap = std::map<std::string, std::unique_ptr<Record>, std::less<>>;
1775  using GlobalMap = std::map<std::string, Init *, std::less<>>;
1776 
1777  std::string InputFilename;
1778  RecordMap Classes, Defs;
1779  mutable StringMap<std::vector<Record *>> ClassRecordsMap;
1780  FoldingSet<RecordRecTy> RecordTypePool;
1781  std::map<std::string, Init *, std::less<>> ExtraGlobals;
1782  unsigned AnonCounter = 0;
1783 
1784  // These members are for the phase timing feature. We need a timer group,
1785  // the last timer started, and a flag to say whether the last timer
1786  // is the special "backend overall timer."
1787  TimerGroup *TimingGroup = nullptr;
1788  Timer *LastTimer = nullptr;
1789  bool BackendTimer = false;
1790 
1791 public:
1792  /// Get the main TableGen input file's name.
1793  const std::string getInputFilename() const { return InputFilename; }
1794 
1795  /// Get the map of classes.
1796  const RecordMap &getClasses() const { return Classes; }
1797 
1798  /// Get the map of records (defs).
1799  const RecordMap &getDefs() const { return Defs; }
1800 
1801  /// Get the map of global variables.
1802  const GlobalMap &getGlobals() const { return ExtraGlobals; }
1803 
1804  /// Get the class with the specified name.
1806  auto I = Classes.find(Name);
1807  return I == Classes.end() ? nullptr : I->second.get();
1808  }
1809 
1810  /// Get the concrete record with the specified name.
1812  auto I = Defs.find(Name);
1813  return I == Defs.end() ? nullptr : I->second.get();
1814  }
1815 
1816  /// Get the \p Init value of the specified global variable.
1818  if (Record *R = getDef(Name))
1819  return R->getDefInit();
1820  auto It = ExtraGlobals.find(Name);
1821  return It == ExtraGlobals.end() ? nullptr : It->second;
1822  }
1823 
1824  void saveInputFilename(std::string Filename) {
1825  InputFilename = Filename;
1826  }
1827 
1828  void addClass(std::unique_ptr<Record> R) {
1829  bool Ins = Classes.insert(std::make_pair(std::string(R->getName()),
1830  std::move(R))).second;
1831  (void)Ins;
1832  assert(Ins && "Class already exists");
1833  }
1834 
1835  void addDef(std::unique_ptr<Record> R) {
1836  bool Ins = Defs.insert(std::make_pair(std::string(R->getName()),
1837  std::move(R))).second;
1838  (void)Ins;
1839  assert(Ins && "Record already exists");
1840  }
1841 
1843  bool Ins = ExtraGlobals.insert(std::make_pair(std::string(Name), I)).second;
1844  (void)Ins;
1845  assert(!getDef(Name));
1846  assert(Ins && "Global already exists");
1847  }
1848 
1850 
1851  /// Start phase timing; called if the --time-phases option is specified.
1853  TimingGroup = new TimerGroup("TableGen", "TableGen Phase Timing");
1854  }
1855 
1856  /// Start timing a phase. Automatically stops any previous phase timer.
1857  void startTimer(StringRef Name);
1858 
1859  /// Stop timing a phase.
1860  void stopTimer();
1861 
1862  /// Start timing the overall backend. If the backend itself starts a timer,
1863  /// then this timer is cleared.
1865 
1866  /// Stop timing the overall backend.
1867  void stopBackendTimer();
1868 
1869  /// Stop phase timing and print the report.
1871  if (TimingGroup)
1872  delete TimingGroup;
1873  }
1874 
1875  //===--------------------------------------------------------------------===//
1876  // High-level helper methods, useful for tablegen backends.
1877 
1878  /// Get all the concrete records that inherit from the one specified
1879  /// class. The class must be defined.
1880  std::vector<Record *> getAllDerivedDefinitions(StringRef ClassName) const;
1881 
1882  /// Get all the concrete records that inherit from all the specified
1883  /// classes. The classes must be defined.
1884  std::vector<Record *> getAllDerivedDefinitions(
1885  ArrayRef<StringRef> ClassNames) const;
1886 
1887  void dump() const;
1888 };
1889 
1890 /// Sorting predicate to sort record pointers by name.
1891 struct LessRecord {
1892  bool operator()(const Record *Rec1, const Record *Rec2) const {
1893  return StringRef(Rec1->getName()).compare_numeric(Rec2->getName()) < 0;
1894  }
1895 };
1896 
1897 /// Sorting predicate to sort record pointers by their
1898 /// unique ID. If you just need a deterministic order, use this, since it
1899 /// just compares two `unsigned`; the other sorting predicates require
1900 /// string manipulation.
1902  bool operator()(const Record *LHS, const Record *RHS) const {
1903  return LHS->getID() < RHS->getID();
1904  }
1905 };
1906 
1907 /// Sorting predicate to sort record pointers by their
1908 /// name field.
1910  bool operator()(const Record *Rec1, const Record *Rec2) const {
1911  return Rec1->getValueAsString("Name") < Rec2->getValueAsString("Name");
1912  }
1913 };
1914 
1916  struct RecordParts {
1918 
1920  if (Rec.empty())
1921  return;
1922 
1923  size_t Len = 0;
1924  const char *Start = Rec.data();
1925  const char *Curr = Start;
1926  bool IsDigitPart = isDigit(Curr[0]);
1927  for (size_t I = 0, E = Rec.size(); I != E; ++I, ++Len) {
1928  bool IsDigit = isDigit(Curr[I]);
1929  if (IsDigit != IsDigitPart) {
1930  Parts.push_back(std::make_pair(IsDigitPart, StringRef(Start, Len)));
1931  Len = 0;
1932  Start = &Curr[I];
1933  IsDigitPart = isDigit(Curr[I]);
1934  }
1935  }
1936  // Push the last part.
1937  Parts.push_back(std::make_pair(IsDigitPart, StringRef(Start, Len)));
1938  }
1939 
1940  size_t size() { return Parts.size(); }
1941 
1942  std::pair<bool, StringRef> getPart(size_t i) {
1943  assert (i < Parts.size() && "Invalid idx!");
1944  return Parts[i];
1945  }
1946  };
1947 
1948  bool operator()(const Record *Rec1, const Record *Rec2) const {
1949  RecordParts LHSParts(StringRef(Rec1->getName()));
1950  RecordParts RHSParts(StringRef(Rec2->getName()));
1951 
1952  size_t LHSNumParts = LHSParts.size();
1953  size_t RHSNumParts = RHSParts.size();
1954  assert (LHSNumParts && RHSNumParts && "Expected at least one part!");
1955 
1956  if (LHSNumParts != RHSNumParts)
1957  return LHSNumParts < RHSNumParts;
1958 
1959  // We expect the registers to be of the form [_a-zA-Z]+([0-9]*[_a-zA-Z]*)*.
1960  for (size_t I = 0, E = LHSNumParts; I < E; I+=2) {
1961  std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I);
1962  std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I);
1963  // Expect even part to always be alpha.
1964  assert (LHSPart.first == false && RHSPart.first == false &&
1965  "Expected both parts to be alpha.");
1966  if (int Res = LHSPart.second.compare(RHSPart.second))
1967  return Res < 0;
1968  }
1969  for (size_t I = 1, E = LHSNumParts; I < E; I+=2) {
1970  std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I);
1971  std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I);
1972  // Expect odd part to always be numeric.
1973  assert (LHSPart.first == true && RHSPart.first == true &&
1974  "Expected both parts to be numeric.");
1975  if (LHSPart.second.size() != RHSPart.second.size())
1976  return LHSPart.second.size() < RHSPart.second.size();
1977 
1978  unsigned LHSVal, RHSVal;
1979 
1980  bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1981  assert(!LHSFailed && "Unable to convert LHS to integer.");
1982  bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1983  assert(!RHSFailed && "Unable to convert RHS to integer.");
1984 
1985  if (LHSVal != RHSVal)
1986  return LHSVal < RHSVal;
1987  }
1988  return LHSNumParts < RHSNumParts;
1989  }
1990 };
1991 
1992 raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
1993 
1994 //===----------------------------------------------------------------------===//
1995 // Resolvers
1996 //===----------------------------------------------------------------------===//
1997 
1998 /// Interface for looking up the initializer for a variable name, used by
1999 /// Init::resolveReferences.
2000 class Resolver {
2001  Record *CurRec;
2002  bool IsFinal = false;
2003 
2004 public:
2005  explicit Resolver(Record *CurRec) : CurRec(CurRec) {}
2006  virtual ~Resolver() {}
2007 
2008  Record *getCurrentRecord() const { return CurRec; }
2009 
2010  /// Return the initializer for the given variable name (should normally be a
2011  /// StringInit), or nullptr if the name could not be resolved.
2012  virtual Init *resolve(Init *VarName) = 0;
2013 
2014  // Whether bits in a BitsInit should stay unresolved if resolving them would
2015  // result in a ? (UnsetInit). This behavior is used to represent instruction
2016  // encodings by keeping references to unset variables within a record.
2017  virtual bool keepUnsetBits() const { return false; }
2018 
2019  // Whether this is the final resolve step before adding a record to the
2020  // RecordKeeper. Error reporting during resolve and related constant folding
2021  // should only happen when this is true.
2022  bool isFinal() const { return IsFinal; }
2023 
2024  void setFinal(bool Final) { IsFinal = Final; }
2025 };
2026 
2027 /// Resolve arbitrary mappings.
2028 class MapResolver final : public Resolver {
2029  struct MappedValue {
2030  Init *V;
2031  bool Resolved;
2032 
2033  MappedValue() : V(nullptr), Resolved(false) {}
2034  MappedValue(Init *V, bool Resolved) : V(V), Resolved(Resolved) {}
2035  };
2036 
2038 
2039 public:
2040  explicit MapResolver(Record *CurRec = nullptr) : Resolver(CurRec) {}
2041 
2042  void set(Init *Key, Init *Value) { Map[Key] = {Value, false}; }
2043 
2044  bool isComplete(Init *VarName) const {
2045  auto It = Map.find(VarName);
2046  assert(It != Map.end() && "key must be present in map");
2047  return It->second.V->isComplete();
2048  }
2049 
2050  Init *resolve(Init *VarName) override;
2051 };
2052 
2053 /// Resolve all variables from a record except for unset variables.
2054 class RecordResolver final : public Resolver {
2056  SmallVector<Init *, 4> Stack;
2057  Init *Name = nullptr;
2058 
2059 public:
2060  explicit RecordResolver(Record &R) : Resolver(&R) {}
2061 
2062  void setName(Init *NewName) { Name = NewName; }
2063 
2064  Init *resolve(Init *VarName) override;
2065 
2066  bool keepUnsetBits() const override { return true; }
2067 };
2068 
2069 /// Delegate resolving to a sub-resolver, but shadow some variable names.
2070 class ShadowResolver final : public Resolver {
2071  Resolver &R;
2072  DenseSet<Init *> Shadowed;
2073 
2074 public:
2076  : Resolver(R.getCurrentRecord()), R(R) {
2077  setFinal(R.isFinal());
2078  }
2079 
2080  void addShadow(Init *Key) { Shadowed.insert(Key); }
2081 
2082  Init *resolve(Init *VarName) override {
2083  if (Shadowed.count(VarName))
2084  return nullptr;
2085  return R.resolve(VarName);
2086  }
2087 };
2088 
2089 /// (Optionally) delegate resolving to a sub-resolver, and keep track whether
2090 /// there were unresolved references.
2091 class TrackUnresolvedResolver final : public Resolver {
2092  Resolver *R;
2093  bool FoundUnresolved = false;
2094 
2095 public:
2096  explicit TrackUnresolvedResolver(Resolver *R = nullptr)
2097  : Resolver(R ? R->getCurrentRecord() : nullptr), R(R) {}
2098 
2099  bool foundUnresolved() const { return FoundUnresolved; }
2100 
2101  Init *resolve(Init *VarName) override;
2102 };
2103 
2104 /// Do not resolve anything, but keep track of whether a given variable was
2105 /// referenced.
2106 class HasReferenceResolver final : public Resolver {
2107  Init *VarNameToTrack;
2108  bool Found = false;
2109 
2110 public:
2111  explicit HasReferenceResolver(Init *VarNameToTrack)
2112  : Resolver(nullptr), VarNameToTrack(VarNameToTrack) {}
2113 
2114  bool found() const { return Found; }
2115 
2116  Init *resolve(Init *VarName) override;
2117 };
2118 
2119 void EmitDetailedRecords(RecordKeeper &RK, raw_ostream &OS);
2120 void EmitJSON(RecordKeeper &RK, raw_ostream &OS);
2121 
2122 } // end namespace llvm
2123 
2124 #endif // LLVM_TABLEGEN_RECORD_H
llvm::Init::isComplete
virtual bool isComplete() const
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:336
llvm::CondOpInit::getConds
ArrayRef< Init * > getConds() const
Definition: Record.h:967
llvm::FieldInit::Fold
Init * Fold(Record *CurRec) const
Definition: Record.cpp:1947
i
i
Definition: README.txt:29
llvm::VarBitInit::classof
static bool classof(const Init *I)
Definition: Record.h:1126
llvm::Init::IK_BinOpInit
@ IK_BinOpInit
Definition: Record.h:297
llvm::Record::getValue
RecordVal * getValue(StringRef Name)
Definition: Record.h:1599
llvm::Resolver::~Resolver
virtual ~Resolver()
Definition: Record.h:2006
llvm::TernOpInit::IF
@ IF
Definition: Record.h:865
llvm::Record::isSubClassOf
bool isSubClassOf(const Record *R) const
Definition: Record.h:1636
llvm::ShadowResolver::resolve
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition: Record.h:2082
llvm::ListInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.cpp:658
llvm::DefInit::getFieldType
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
Definition: Record.cpp:1785
llvm::BinOpInit::XOR
@ XOR
Definition: Record.h:808
llvm::OpInit::operator=
OpInit & operator=(OpInit &)=delete
TrailingObjects.h
llvm::CondOpInit::const_val_iterator
SmallVectorImpl< Init * >::const_iterator const_val_iterator
Definition: Record.h:984
llvm::RecordKeeper::getInputFilename
const std::string getInputFilename() const
Get the main TableGen input file's name.
Definition: Record.h:1793
llvm::TernOpInit::getOpcode
TernaryOp getOpcode() const
Definition: Record.h:906
llvm::Init::IK_StringInit
@ IK_StringInit
Definition: Record.h:305
llvm::VarBitInit::getBit
Init * getBit(unsigned B) const override
Get the Init value of the specified bit.
Definition: Record.h:1138
llvm::ListInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:674
llvm::ListInit::convertInitListSlice
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This function is used to implement the list slice selection operator.
Definition: Record.cpp:617
llvm::RecordVal::getPrintType
std::string getPrintType() const
Get the type of the field for printing purposes.
Definition: Record.cpp:2228
llvm::StringInit::operator=
StringInit & operator=(const StringInit &)=delete
llvm::IsAOpInit::Fold
Init * Fold() const
Definition: Record.cpp:1569
llvm::Resolver::setFinal
void setFinal(bool Final)
Definition: Record.h:2024
llvm
Definition: AllocatorList.h:23
llvm::TernOpInit::getNumOperands
unsigned getNumOperands() const override
Definition: Record.h:896
llvm::SmallVectorImpl::erase
iterator erase(const_iterator CI)
Definition: SmallVector.h:705
llvm::tgtok::Def
@ Def
Definition: TGLexer.h:50
llvm::StringRecTy
'string' - Represent an string value
Definition: Record.h:160
llvm::IntInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:466
llvm::VarDefInit::args
ArrayRef< Init * > args() const
Definition: Record.h:1256
llvm::StringInit::hasCodeFormat
bool hasCodeFormat() const
Definition: Record.h:641
llvm::RecordKeeper
Definition: Record.h:1771
llvm::RecordVal::isTemplateArg
bool isTemplateArg() const
Is this a template argument?
Definition: Record.h:1442
llvm::DagInit::name_begin
const_name_iterator name_begin() const
Definition: Record.h:1385
llvm::StringRef::empty
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:156
llvm::RecordVal::FK_Normal
@ FK_Normal
Definition: Record.h:1407
llvm::Init::convertInitializerTo
virtual Init * convertInitializerTo(RecTy *Ty) const =0
Convert to a value whose type is Ty, or return null if this is not possible.
llvm::RecTy::RecTy
RecTy(RecTyKind K)
Definition: Record.h:75
llvm::CondOpInit::getCond
Init * getCond(unsigned Num) const
Definition: Record.h:957
llvm::UnsetInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:463
llvm::RecordRecTy::get
static RecordRecTy * get(ArrayRef< Record * > Classes)
Get the record type with the given non-redundant list of superclasses.
Definition: Record.cpp:148
llvm::Init::Opc
uint8_t Opc
Definition: Record.h:318
llvm::RecTy::DagRecTyKind
@ DagRecTyKind
Definition: Record.h:65
llvm::TypedInit::getCastTo
Init * getCastTo(RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
Definition: Record.cpp:1644
llvm::AnonymousNameInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:513
llvm::Init::getCastTo
virtual Init * getCastTo(RecTy *Ty) const =0
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
llvm::Record::getDirectSuperClasses
void getDirectSuperClasses(SmallVectorImpl< Record * > &Classes) const
Append the direct superclasses of this record to Classes.
Definition: Record.cpp:2361
llvm::FieldInit::operator=
FieldInit & operator=(const FieldInit &)=delete
llvm::BitsInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:413
llvm::VarListElementInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:1765
llvm::UnOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:840
llvm::OpInit
Base class for operators.
Definition: Record.h:732
llvm::TernOpInit::FOREACH
@ FOREACH
Definition: Record.h:865
llvm::ListInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:589
llvm::BinOpInit::get
static BinOpInit * get(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type)
Definition: Record.cpp:863
llvm::IntInit::convertInitializerBitRange
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
Definition: Record.cpp:493
llvm::StringInit::get
static StringInit * get(StringRef, StringFormat Fmt=SF_String)
Definition: Record.cpp:527
llvm::OpInit::OpInit
OpInit(InitKind K, RecTy *Type, uint8_t Opc)
Definition: Record.h:734
llvm::Record::getValueAsListOfDefs
std::vector< Record * > getValueAsListOfDefs(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of records,...
Definition: Record.cpp:2522
StringRef.h
llvm::BinOpInit::AND
@ AND
Definition: Record.h:808
llvm::CondOpInit::val_size
size_t val_size() const
Definition: Record.h:995
llvm::Record::Record
Record(Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false, bool Class=false)
Definition: Record.h:1516
llvm::TernOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1456
llvm::FoldOpInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:1029
llvm::TypedInit::getFieldType
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
Definition: Record.cpp:1606
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::IsAOpInit
!isa<type>(expr) - Dynamically determine the type of an expression.
Definition: Record.h:1039
llvm::RecTy::ListRecTyKind
@ ListRecTyKind
Definition: Record.h:64
llvm::TypedInit::operator=
TypedInit & operator=(const TypedInit &)=delete
llvm::BitsRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:94
llvm::UnsetInit::getAsString
std::string getAsString() const override
Get the string representation of the Init.
Definition: Record.h:466
llvm::OpInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:685
llvm::VarListElementInit::getVariable
TypedInit * getVariable() const
Definition: Record.h:1168
llvm::BitsRecTy::getNumBits
unsigned getNumBits() const
Definition: Record.h:132
ErrorHandling.h
llvm::FieldInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1940
llvm::TernOpInit::clone
OpInit * clone(ArrayRef< Init * > Operands) const override
Definition: Record.h:889
llvm::Record::getSuperClasses
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses() const
Definition: Record.h:1571
llvm::VarDefInit::classof
static bool classof(const Init *I)
Definition: Record.h:1231
llvm::DagInit
(v a, b) - Represent a DAG tree value.
Definition: Record.h:1307
llvm::FieldInit::get
static FieldInit * get(Init *R, StringInit *FN)
Definition: Record.cpp:1923
llvm::tgtok::VarName
@ VarName
Definition: TGLexer.h:71
llvm::UnOpInit::getNumOperands
unsigned getNumOperands() const override
Definition: Record.h:786
llvm::LessRecordByID
Sorting predicate to sort record pointers by their unique ID.
Definition: Record.h:1901
llvm::Init::IK_CondOpInit
@ IK_CondOpInit
Definition: Record.h:301
llvm::OpInit::getOperand
virtual Init * getOperand(unsigned i) const =0
llvm::IntInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:575
llvm::VarDefInit::args_empty
bool args_empty() const
Definition: Record.h:1254
llvm::TrackUnresolvedResolver
(Optionally) delegate resolving to a sub-resolver, and keep track whether there were unresolved refer...
Definition: Record.h:2091
llvm::DagInit::arg_size
size_t arg_size() const
Definition: Record.h:1382
llvm::DefInit::classof
static bool classof(const Init *I)
Definition: Record.h:1189
llvm::RecordVal::getNameInitAsString
std::string getNameInitAsString() const
Get the name of the field as a std::string.
Definition: Record.h:1429
llvm::RecTy::print
void print(raw_ostream &OS) const
Definition: Record.h:81
llvm::CondOpInit::const_case_iterator
SmallVectorImpl< Init * >::const_iterator const_case_iterator
Definition: Record.h:983
llvm::BinOpInit::OR
@ OR
Definition: Record.h:808
llvm::Init::IK_UnOpInit
@ IK_UnOpInit
Definition: Record.h:299
llvm::Record::addAssertion
void addAssertion(SMLoc Loc, Init *Condition, Init *Message)
Definition: Record.h:1626
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
DenseMap.h
llvm::Timer
This class is used to track the amount of time spent between invocations of its startTimer()/stopTime...
Definition: Timer.h:82
llvm::IntRecTy
'int' - Represent an integer value of no particular size
Definition: Record.h:142
llvm::MapResolver::set
void set(Init *Key, Init *Value)
Definition: Record.h:2042
llvm::BinOpInit
!op (X, Y) - Combine two inits.
Definition: Record.h:806
llvm::tgtok::Bits
@ Bits
Definition: TGLexer.h:50
llvm::BinOpInit::SRA
@ SRA
Definition: Record.h:808
llvm::sys::path::end
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:233
llvm::Record::removeValue
void removeValue(StringRef Name)
Definition: Record.h:1622
llvm::AnonymousNameInit::getNameInit
StringInit * getNameInit() const
Definition: Record.cpp:509
llvm::sys::path::begin
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:224
T1
#define T1
Definition: Mips16ISelLowering.cpp:340
llvm::TernOpInit
!op (X, Y, Z) - Combine two inits.
Definition: Record.h:863
llvm::RecTy::dump
void dump() const
Definition: Record.cpp:56
llvm::BinOpInit::operator=
BinOpInit & operator=(const BinOpInit &)=delete
llvm::DagRecTy
'dag' - Represent a dag fragment
Definition: Record.h:202
llvm::RecTy::BitsRecTyKind
@ BitsRecTyKind
Definition: Record.h:61
llvm::FoldOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1537
llvm::OpInit::clone
virtual OpInit * clone(ArrayRef< Init * > Operands) const =0
llvm::Optional
Definition: APInt.h:33
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::DagInit::getOperatorAsDef
Record * getOperatorAsDef(ArrayRef< SMLoc > Loc) const
Definition: Record.cpp:2157
llvm::FoldOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:1018
llvm::BitRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:72
llvm::DagInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:2191
llvm::Record::getLoc
ArrayRef< SMLoc > getLoc() const
Definition: Record.h:1552
llvm::BinOpInit::GT
@ GT
Definition: Record.h:810
llvm::TernOpInit::SUBST
@ SUBST
Definition: Record.h:865
llvm::VarBitInit::get
static VarBitInit * get(TypedInit *T, unsigned B)
Definition: Record.cpp:1712
llvm::ListInit::get
static ListInit * get(ArrayRef< Init * > Range, RecTy *EltTy)
Definition: Record.cpp:561
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:892
llvm::FoldOpInit::get
static FoldOpInit * get(Init *Start, Init *List, Init *A, Init *B, Init *Expr, RecTy *Type)
Definition: Record.cpp:1484
llvm::Init::IK_FoldOpInit
@ IK_FoldOpInit
Definition: Record.h:302
llvm::Init::getBit
virtual Init * getBit(unsigned Bit) const =0
Get the Init value of the specified bit.
llvm::BinOpInit::getStrConcat
static Init * getStrConcat(Init *lhs, Init *rhs)
Definition: Record.cpp:936
llvm::Init::getKind
InitKind getKind() const
Get the kind (type) of the value.
Definition: Record.h:325
llvm::Record::AssertionInfo::Message
Init * Message
Definition: Record.h:1477
llvm::TernOpInit::SUBSTR
@ SUBSTR
Definition: Record.h:865
llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert
std::pair< iterator, bool > insert(const ValueT &V)
Definition: DenseSet.h:206
llvm::Init::IK_FirstTypedInit
@ IK_FirstTypedInit
Definition: Record.h:288
llvm::Record::getValueAsOptionalDef
Record * getValueAsOptionalDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, returning null if the fie...
Definition: Record.cpp:2593
llvm::Record::AssertionInfo::Loc
SMLoc Loc
Definition: Record.h:1475
llvm::OpInit::classof
static bool classof(const Init *I)
Definition: Record.h:741
llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::count
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
Definition: DenseSet.h:97
llvm::RecordVal::FieldKind
FieldKind
Definition: Record.h:1406
llvm::DagInit::getArg
Init * getArg(unsigned Num) const
Definition: Record.h:1348
p
the resulting code requires compare and branches when and if * p
Definition: README.txt:396
llvm::VarInit
'Opcode' - Represent a reference to an entire variable object.
Definition: Record.h:1072
llvm::RecordRecTy::operator=
RecordRecTy & operator=(const RecordRecTy &)=delete
llvm::FieldInit::getRecord
Init * getRecord() const
Definition: Record.h:1290
llvm::RecordVal::FK_NonconcreteOK
@ FK_NonconcreteOK
Definition: Record.h:1408
llvm::Init::InitKind
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Definition: Record.h:286
llvm::IntInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:572
llvm::Record::getFieldLoc
SMLoc getFieldLoc(StringRef FieldName) const
Return the source location for the named field.
Definition: Record.cpp:2457
llvm::TernOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:878
llvm::AnonymousNameInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:517
llvm::DagInit::getOperator
Init * getOperator() const
Definition: Record.h:1337
llvm::RecTy
Definition: Record.h:56
llvm::ListRecTy::typeIsA
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
Definition: Record.cpp:131
llvm::DagInit::const_name_iterator
SmallVectorImpl< StringInit * >::const_iterator const_name_iterator
Definition: Record.h:1377
llvm::Init::operator=
Init & operator=(const Init &)=delete
llvm::TernOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:1206
llvm::RISCVFenceField::R
@ R
Definition: RISCVBaseInfo.h:191
llvm::BitRecTy
'bit' - Represent a single bit
Definition: Record.h:102
llvm::TernOpInit::Fold
Init * Fold(Record *CurRec) const
Definition: Record.cpp:1289
llvm::TypedInit::TypedInit
TypedInit(InitKind K, RecTy *T, uint8_t Opc=0)
Definition: Record.h:411
llvm::LessRecordRegister::RecordParts::size
size_t size()
Definition: Record.h:1940
llvm::Record::getValueAsListInit
ListInit * getValueAsListInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a ListInit, throwing an exception i...
Definition: Record.cpp:2509
llvm::UnOpInit::getOperand
Init * getOperand(unsigned i) const override
Definition: Record.h:788
llvm::CondOpInit::Fold
Init * Fold(Record *CurRec) const
Definition: Record.cpp:2042
llvm::ListInit::getElementType
RecTy * getElementType() const
Definition: Record.h:694
llvm::BinOpInit::getLHS
Init * getLHS() const
Definition: Record.h:850
PointerIntPair.h
llvm::BitsRecTy
'bits<n>' - Represent a fixed number of bits
Definition: Record.h:120
llvm::RecordKeeper::startBackendTimer
void startBackendTimer(StringRef Name)
Start timing the overall backend.
Definition: Record.cpp:2710
llvm::Resolver
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition: Record.h:2000
llvm::Record::getTemplateArgs
ArrayRef< Init * > getTemplateArgs() const
Definition: Record.h:1563
llvm::StringInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:658
llvm::BitsRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:126
InputFilename
static cl::opt< std::string > InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"))
llvm::StringInit::SF_String
@ SF_String
Definition: Record.h:614
llvm::IntRecTy::getAsString
std::string getAsString() const override
Definition: Record.h:154
llvm::BinOpInit::getRHS
Init * getRHS() const
Definition: Record.h:851
llvm::ListInit::begin
const_iterator begin() const
Definition: Record.h:719
llvm::Record::resolveReferences
void resolveReferences(Init *NewName=nullptr)
If there are any field references that refer to fields that have been filled in, we can propagate the...
Definition: Record.cpp:2410
llvm::RecordKeeper::startTimer
void startTimer(StringRef Name)
Start timing a phase. Automatically stops any previous phase timer.
Definition: Record.cpp:2688
llvm::BitsInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.cpp:391
llvm::CondOpInit::name_end
const_val_iterator name_end() const
Definition: Record.h:993
llvm::FieldInit::getFieldName
StringInit * getFieldName() const
Definition: Record.h:1291
llvm::Record::Record
Record(const Record &O)
Definition: Record.h:1530
llvm::CondOpInit::getVals
ArrayRef< Init * > getVals() const
Definition: Record.h:971
llvm::ShadowResolver::ShadowResolver
ShadowResolver(Resolver &R)
Definition: Record.h:2075
llvm::UnsetInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:456
llvm::Record::AssertionInfo::Condition
Init * Condition
Definition: Record.h:1476
llvm::UnOpInit::GETDAGOP
@ GETDAGOP
Definition: Record.h:759
llvm::LessRecordFieldName
Sorting predicate to sort record pointers by their name field.
Definition: Record.h:1909
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
llvm::BitInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.h:495
llvm::VarDefInit::getArg
Init * getArg(unsigned i) const
Definition: Record.h:1243
llvm::BitInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:489
llvm::VarListElementInit::getElementNum
unsigned getElementNum() const
Definition: Record.h:1169
llvm::CondOpInit::arg_begin
const_case_iterator arg_begin() const
Definition: Record.h:986
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::StringRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:116
llvm::SmallVectorImpl::append
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
Definition: SmallVector.h:648
llvm::Record::AssertionInfo::AssertionInfo
AssertionInfo(SMLoc Loc, Init *Condition, Init *Message)
Definition: Record.h:1481
llvm::ListRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:187
llvm::FoldOpInit
!foldl (a, b, expr, start, lst) - Fold over a list.
Definition: Record.h:1002
llvm::Resolver::keepUnsetBits
virtual bool keepUnsetBits() const
Definition: Record.h:2017
llvm::BitsInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:399
llvm::UnOpInit::UnaryOp
UnaryOp
Definition: Record.h:759
llvm::IsAOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1589
llvm::DagInit::arg_empty
bool arg_empty() const
Definition: Record.h:1383
llvm::BinOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1142
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::DagRecTy::get
static DagRecTy * get()
Definition: Record.h:212
llvm::BinOpInit::BinaryOp
BinaryOp
Definition: Record.h:808
llvm::ListInit::classof
static bool classof(const Init *I)
Definition: Record.h:683
llvm::AnonymousNameInit::operator=
AnonymousNameInit & operator=(const AnonymousNameInit &)=delete
llvm::ListRecTy::getElementType
RecTy * getElementType() const
Definition: Record.h:192
llvm::TrackUnresolvedResolver::resolve
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition: Record.cpp:2804
llvm::RecordKeeper::addDef
void addDef(std::unique_ptr< Record > R)
Definition: Record.h:1835
llvm::CondOpInit
!cond(condition_1: value1, ...
Definition: Record.h:927
llvm::Init::getFieldType
virtual RecTy * getFieldType(StringInit *FieldName) const
This function is used to implement the FieldInit class.
Definition: Record.h:385
llvm::StringInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:645
SI
@ SI
Definition: SIInstrInfo.cpp:7463
llvm::Record::AssertionInfo
Definition: Record.h:1474
llvm::UnsetInit::get
static UnsetInit * get()
Get the singleton unset Init.
Definition: Record.cpp:286
llvm::DagInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.cpp:2181
llvm::UnOpInit::CAST
@ CAST
Definition: Record.h:759
llvm::DagRecTy::getAsString
std::string getAsString() const override
Definition: Record.cpp:137
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:481
DenseSet.h
llvm::Init::dump
void dump() const
Debugging method that may be called through a debugger; just invokes print on stderr.
Definition: Record.cpp:283
false
Definition: StackSlotColoring.cpp:142
llvm::LessRecord
Sorting predicate to sort record pointers by name.
Definition: Record.h:1891
llvm::RecordKeeper::stopBackendTimer
void stopBackendTimer()
Stop timing the overall backend.
Definition: Record.cpp:2717
llvm::BinOpInit::ADD
@ ADD
Definition: Record.h:808
llvm::Init::IK_DefInit
@ IK_DefInit
Definition: Record.h:292
llvm::TernOpInit::getRHS
Init * getRHS() const
Definition: Record.h:909
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::Record::addTemplateArg
void addTemplateArg(Init *Name)
Definition: Record.h:1603
llvm::IntInit::get
static IntInit * get(int64_t V)
Definition: Record.cpp:448
llvm::ListInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
Definition: Record.cpp:642
SMLoc.h
llvm::DagInit::classof
static bool classof(const Init *I)
Definition: Record.h:1326
llvm::TypedInit::getType
RecTy * getType() const
Get the type of the Init as a RecTy.
Definition: Record.h:424
llvm::Init::IK_TernOpInit
@ IK_TernOpInit
Definition: Record.h:298
llvm::IntRecTy::get
static IntRecTy * get()
Definition: Record.h:152
llvm::RecordRecTy::getAsString
std::string getAsString() const override
Definition: Record.cpp:193
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:50
llvm::FoldOpInit::operator=
FoldOpInit & operator=(const FoldOpInit &)=delete
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::OpInit::getNumOperands
virtual unsigned getNumOperands() const =0
llvm::BinOpInit::getListConcat
static Init * getListConcat(TypedInit *lhs, Init *rhs)
Definition: Record.cpp:952
llvm::DefInit::getDef
Record * getDef() const
Definition: Record.h:1197
llvm::ListInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.cpp:666
llvm::DagInit::getName
StringInit * getName() const
Definition: Record.h:1340
llvm::IsAOpInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:1062
llvm::IsAOpInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:1596
llvm::VarDefInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:1822
llvm::Record::getValue
const RecordVal * getValue(StringRef Name) const
Definition: Record.h:1591
llvm::HasReferenceResolver
Do not resolve anything, but keep track of whether a given variable was referenced.
Definition: Record.h:2106
llvm::BitsInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:544
llvm::TernOpInit::get
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
Definition: Record.cpp:1190
llvm::RecordVal::getValue
Init * getValue() const
Get the value of the field as an Init.
Definition: Record.h:1453
llvm::RecordKeeper::startPhaseTiming
void startPhaseTiming()
Start phase timing; called if the –time-phases option is specified.
Definition: Record.h:1852
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:248
llvm::CondOpInit::getNumConds
unsigned getNumConds() const
Definition: Record.h:955
llvm::IntInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:456
llvm::CondOpInit::get
static CondOpInit * get(ArrayRef< Init * > C, ArrayRef< Init * > V, RecTy *Type)
Definition: Record.cpp:1994
llvm::UnsetInit::classof
static bool classof(const Init *I)
Definition: Record.h:446
llvm::ShadowResolver::addShadow
void addShadow(Init *Key)
Definition: Record.h:2080
llvm::AnonymousNameInit
"anonymous_n" - Represent an anonymous record name
Definition: Record.h:581
llvm::DagInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:1391
llvm::DagInit::name_size
size_t name_size() const
Definition: Record.h:1388
llvm::FieldInit
X.Y - Represent a reference to a subfield of a variable.
Definition: Record.h:1264
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::TernOpInit::DAG
@ DAG
Definition: Record.h:865
llvm::RecordVal::dump
void dump() const
Definition: Record.cpp:2292
llvm::Record::dump
void dump() const
Definition: Record.cpp:2418
llvm::IsAOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1600
llvm::ListInit::const_iterator
Init *const * const_iterator
Definition: Record.h:670
llvm::BitsInit::operator=
BitsInit & operator=(const BitsInit &)=delete
llvm::BinOpInit::LISTSPLAT
@ LISTSPLAT
Definition: Record.h:809
llvm::Init::IK_VarDefInit
@ IK_VarDefInit
Definition: Record.h:309
Operands
mir Rename Register Operands
Definition: MIRNamerPass.cpp:78
llvm::LessRecordByID::operator()
bool operator()(const Record *LHS, const Record *RHS) const
Definition: Record.h:1902
llvm::StringInit::SF_Code
@ SF_Code
Definition: Record.h:615
llvm::AnonymousNameInit::get
static AnonymousNameInit * get(unsigned)
Definition: Record.cpp:505
llvm::Init::IK_VarBitInit
@ IK_VarBitInit
Definition: Record.h:308
llvm::BitInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:306
llvm::TernOpInit::TernaryOp
TernaryOp
Definition: Record.h:865
llvm::RecordRecTy::typeIsA
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
Definition: Record.cpp:229
llvm::IntInit::classof
static bool classof(const Init *I)
Definition: Record.h:561
llvm::Record::getAssertions
ArrayRef< AssertionInfo > getAssertions() const
Definition: Record.h:1569
llvm::BinOpInit::NE
@ NE
Definition: Record.h:810
llvm::TrackUnresolvedResolver::TrackUnresolvedResolver
TrackUnresolvedResolver(Resolver *R=nullptr)
Definition: Record.h:2096
llvm::PointerIntPair::getPointer
PointerTy getPointer() const
Definition: PointerIntPair.h:59
llvm::VarBitInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1724
llvm::VarDefInit::operator=
VarDefInit & operator=(const VarDefInit &)=delete
llvm::CondOpInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.cpp:2062
llvm::FieldInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.cpp:1962
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition: DenseSet.h:268
llvm::UnOpInit
!op (X) - Transform an init.
Definition: Record.h:757
Timer.h
llvm::RecordVal::setValue
bool setValue(Init *V)
Set the value of the field from an Init.
Definition: Record.cpp:2243
llvm::Resolver::getCurrentRecord
Record * getCurrentRecord() const
Definition: Record.h:2008
llvm::Init::isConcrete
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:340
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:190
llvm::ListInit::operator=
ListInit & operator=(const ListInit &)=delete
llvm::UnOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:771
llvm::Init::IK_AnonymousNameInit
@ IK_AnonymousNameInit
Definition: Record.h:304
llvm::VarDefInit::args_end
const_iterator args_end() const
Definition: Record.h:1251
llvm::UnsetInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:295
llvm::VarListElementInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1752
llvm::BitInit::getValue
bool getValue() const
Definition: Record.h:485
llvm::IsAOpInit::get
static IsAOpInit * get(RecTy *CheckType, Init *Expr)
Definition: Record.cpp:1550
llvm::EmitDetailedRecords
void EmitDetailedRecords(RecordKeeper &RK, raw_ostream &OS)
Definition: DetailedRecordsBackend.cpp:199
llvm::IntInit
'7' - Represent an initialization by a literal integer value.
Definition: Record.h:551
llvm::Record::getDefInit
DefInit * getDefInit()
get the corresponding DefInit.
Definition: Record.cpp:2321
llvm::DefInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1791
llvm::DefInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:1778
llvm::Record::getNewUID
static unsigned getNewUID()
Definition: Record.h:1536
llvm::ListInit
[AL, AH, CL] - Represent a list of defs
Definition: Record.h:665
llvm::StringInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:544
llvm::Init::convertInitListSlice
virtual Init * convertInitListSlice(ArrayRef< unsigned > Elements) const
This function is used to implement the list slice selection operator.
Definition: Record.h:378
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::StringInit::classof
static bool classof(const Init *I)
Definition: Record.h:629
llvm::MapResolver
Resolve arbitrary mappings.
Definition: Record.h:2028
llvm::RecordVal::print
void print(raw_ostream &OS, bool PrintSem=true) const
Print the value to an output stream, possibly with a semicolon.
Definition: Record.cpp:2295
llvm::Init::~Init
virtual ~Init()=default
llvm::RecordRecTy::const_record_iterator
Record *const * const_record_iterator
Definition: Record.h:250
llvm::Record::getValues
ArrayRef< RecordVal > getValues() const
Definition: Record.h:1567
llvm::DefInit
AL - Represent a reference to a 'def' in the description.
Definition: Record.h:1178
llvm::TernOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1426
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
llvm::DenseMap
Definition: DenseMap.h:714
llvm::VarInit::get
static VarInit * get(StringRef VN, RecTy *T)
Definition: Record.cpp:1678
llvm::Init::Init
Init(InitKind K, uint8_t Opc=0)
Definition: Record.h:328
llvm::RecordRecTy
'[classname]' - Type of record values that have zero or more superclasses.
Definition: Record.h:221
llvm::ShadowResolver
Delegate resolving to a sub-resolver, but shadow some variable names.
Definition: Record.h:2070
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::Record::addValue
void addValue(const RecordVal &RV)
Definition: Record.h:1608
llvm::PointerIntPair::getInt
IntType getInt() const
Definition: PointerIntPair.h:61
llvm::BitsInit::allInComplete
bool allInComplete() const
Definition: Record.h:533
llvm::ListInit::size
size_t size() const
Definition: Record.h:722
StringExtras.h
llvm::Resolver::Resolver
Resolver(Record *CurRec)
Definition: Record.h:2005
llvm::BitInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:494
llvm::Init::IK_First
@ IK_First
Definition: Record.h:287
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1547
llvm::Record::getNameInitAsString
const std::string getNameInitAsString() const
Definition: Record.h:1546
llvm::ListInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:725
ArrayRef.h
llvm::Record::isClass
bool isClass() const
Definition: Record.h:1561
llvm::IntInit::getValue
int64_t getValue() const
Definition: Record.h:567
llvm::IntRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:148
llvm::Record::checkRecordAssertions
void checkRecordAssertions()
Definition: Record.cpp:2653
llvm::BinOpInit::clone
OpInit * clone(ArrayRef< Init * > Operands) const override
Definition: Record.h:834
llvm::BitsRecTy::typeIsA
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
Definition: Record.cpp:101
llvm::resolveTypes
RecTy * resolveTypes(RecTy *T1, RecTy *T2)
Find a common type that T1 and T2 convert to.
Definition: Record.cpp:250
llvm::BinOpInit::GE
@ GE
Definition: Record.h:810
llvm::DefInit::isConcrete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?...
Definition: Record.h:1203
llvm::BinOpInit::SHL
@ SHL
Definition: Record.h:808
llvm::SmallVectorImpl::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:563
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::ListRecTy
'list<Ty>' - Represent a list of element values, all of which must be of the specified type.
Definition: Record.h:179
llvm::Record::getValueAsListOfStrings
std::vector< StringRef > getValueAsListOfStrings(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of strings,...
Definition: Record.cpp:2566
llvm::IsAOpInit::operator=
IsAOpInit & operator=(const IsAOpInit &)=delete
llvm::FoldOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1518
llvm::RecordKeeper::stopPhaseTiming
void stopPhaseTiming()
Stop phase timing and print the report.
Definition: Record.h:1870
llvm::Init::IK_FieldInit
@ IK_FieldInit
Definition: Record.h:293
llvm::TypedInit::convertInitializerBitRange
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
Definition: Record.cpp:1628
llvm::BinOpInit::Fold
Init * Fold(Record *CurRec) const
Definition: Record.cpp:962
llvm::DefInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:1206
llvm::Init::resolveReferences
virtual Init * resolveReferences(Resolver &R) const
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.h:393
llvm::BinOpInit::LISTCONCAT
@ LISTCONCAT
Definition: Record.h:808
llvm::CondOpInit::arg_end
const_case_iterator arg_end() const
Definition: Record.h:987
llvm::Init::getAsUnquotedString
virtual std::string getAsUnquotedString() const
Convert this value to a literal form, without adding quotes around a string.
Definition: Record.h:350
llvm::Record::removeValue
void removeValue(Init *Name)
Definition: Record.h:1613
llvm::Record::getValueAsListOfInts
std::vector< int64_t > getValueAsListOfInts(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of integers,...
Definition: Record.cpp:2550
llvm::BinOpInit::EQ
@ EQ
Definition: Record.h:809
llvm::RecordResolver::RecordResolver
RecordResolver(Record &R)
Definition: Record.h:2060
llvm::VarBitInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1728
B
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional ldr LCPI1_0 ldr ldr tst movne lsr ldr LCPI1_1 and r0 bx lr it saves an instruction and a register It might be profitable to cse MOVi16 if there are lots of bit immediates with the same bottom half Robert Muth started working on an alternate jump table implementation that does not put the tables in line in the text This is more like the llvm default jump table implementation This might be useful sometime Several revisions of patches are on the mailing beginning while CMP sets them like a subtract Therefore to be able to use CMN for comparisons other than the Z we ll need additional logic to reverse the conditionals associated with the comparison Perhaps a pseudo instruction for the with a post codegen pass to clean up and handle the condition codes See PR5694 for testcase Given the following on int B
Definition: README.txt:592
llvm::Record::getValueAsDag
DagInit * getValueAsDag(StringRef FieldName) const
This method looks up the specified field and returns its value as an Dag, throwing an exception if th...
Definition: Record.cpp:2637
llvm::RecordKeeper::getDefs
const RecordMap & getDefs() const
Get the map of records (defs).
Definition: Record.h:1799
llvm::Record
Definition: Record.h:1472
llvm::VarInit::getName
StringRef getName() const
Definition: Record.cpp:1695
llvm::MapResolver::resolve
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition: Record.cpp:2761
llvm::RecordKeeper::getClass
Record * getClass(StringRef Name) const
Get the class with the specified name.
Definition: Record.h:1805
llvm::BinOpInit::SUB
@ SUB
Definition: Record.h:808
llvm::AnonymousNameInit::classof
static bool classof(const Init *I)
Definition: Record.h:591
llvm::Init::getAsString
virtual std::string getAsString() const =0
Convert this value to a literal form.
llvm::StringRef::compare_numeric
LLVM_NODISCARD int compare_numeric(StringRef RHS) const
compare_numeric - Compare two strings, treating sequences of digits as numbers.
Definition: StringRef.cpp:64
llvm::VarInit::getNameInitAsString
std::string getNameInitAsString() const
Definition: Record.h:1092
llvm::RecordResolver::setName
void setName(Init *NewName)
Definition: Record.h:2062
llvm::StringRecTy::getAsString
std::string getAsString() const override
Definition: Record.cpp:112
llvm::Record::Record
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Class=false)
Definition: Record.h:1523
llvm::UnOpInit::NOT
@ NOT
Definition: Record.h:759
llvm::Record::getValueAsBitsInit
BitsInit * getValueAsBitsInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a BitsInit, throwing an exception i...
Definition: Record.cpp:2497
llvm::VarInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.h:1105
llvm::Record::getType
RecordRecTy * getType()
Definition: Record.cpp:2315
llvm::RecordKeeper::getClasses
const RecordMap & getClasses() const
Get the map of classes.
Definition: Record.h:1796
llvm::TypedInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:1617
llvm::VarInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
Definition: Record.cpp:1706
llvm::StringInit
"foo" - Represent an initialization by a string value.
Definition: Record.h:611
llvm::BitsInit::convertInitializerTo
Init * convertInitializerTo(RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition: Record.cpp:353
llvm::FoldingSet
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
Definition: FoldingSet.h:493
llvm::BinOpInit::INTERLEAVE
@ INTERLEAVE
Definition: Record.h:809
isDigit
static bool isDigit(const char C)
Definition: RustDemangle.cpp:81
llvm::Record::isSubClassOf
bool isSubClassOf(StringRef Name) const
Definition: Record.h:1643
llvm::RecordKeeper::getAllDerivedDefinitions
std::vector< Record * > getAllDerivedDefinitions(StringRef ClassName) const
Get all the concrete records that inherit from the one specified class.
Definition: Record.cpp:2728
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::Record::addSuperClass
void addSuperClass(Record *R, SMRange Range)
Definition: Record.h:1655
llvm::CondOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:2086
llvm::UnOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:713
llvm::Init::IK_IntInit
@ IK_IntInit
Definition: Record.h:294
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::LessRecordRegister::RecordParts::Parts
SmallVector< std::pair< bool, StringRef >, 4 > Parts
Definition: Record.h:1917
llvm::BitsInit::getNumBits
unsigned getNumBits() const
Definition: Record.h:522
llvm::TernOpInit::getLHS
Init * getLHS() const
Definition: Record.h:907
llvm::FoldingSetBase::Node
Node - This class is used to maintain the singly linked bucket list in a folding set.
Definition: FoldingSet.h:133
llvm::AnonymousNameInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:605
llvm::BitInit
'true'/'false' - Represent a concrete initializer for a bit.
Definition: Record.h:470
llvm::RecordKeeper::getGlobal
Init * getGlobal(StringRef Name) const
Get the Init value of the specified global variable.
Definition: Record.h:1817
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::CondOpInit::getVal
Init * getVal(unsigned Num) const
Definition: Record.h:962
llvm::RecordVal::getNameInit
Init * getNameInit() const
Get the name of the field as an Init.
Definition: Record.h:1426
llvm::RecTy::typeIsA
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
Definition: Record.cpp:70
llvm::EmitJSON
void EmitJSON(RecordKeeper &RK, raw_ostream &OS)
Definition: JSONBackend.cpp:184
llvm::Record::getNameInit
Init * getNameInit() const
Definition: Record.h:1542
llvm::RecordRecTy::getClasses
ArrayRef< Record * > getClasses() const
Definition: Record.h:246
llvm::CondOpInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.cpp:2074
llvm::FoldOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:1500
llvm::ListRecTy::get
static ListRecTy * get(RecTy *T)
Definition: Record.h:191
llvm::Record::getID
unsigned getID() const
Definition: Record.h:1538
llvm::FoldingSetNodeID
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:313
llvm::ListInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:583
llvm::ListInit::empty
bool empty() const
Definition: Record.h:723
llvm::VarDefInit::args_size
size_t args_size() const
Definition: Record.h:1253
llvm::DagInit::getArgNames
ArrayRef< StringInit * > getArgNames() const
Definition: Record.h:1367
llvm::HasReferenceResolver::found
bool found() const
Definition: Record.h:2114
llvm::BitRecTy::get
static BitRecTy * get()
Definition: Record.h:112
llvm::Init::IK_DagInit
@ IK_DagInit
Definition: Record.h:291
llvm::DagInit::const_arg_iterator
SmallVectorImpl< Init * >::const_iterator const_arg_iterator
Definition: Record.h:1376
llvm::Init::IK_BitsInit
@ IK_BitsInit
Definition: Record.h:290
llvm::BitRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:108
llvm::DagInit::operator=
DagInit & operator=(const DagInit &)=delete
llvm::RecordVal::FK_TemplateArg
@ FK_TemplateArg
Definition: Record.h:1409
llvm::DagInit::getArgs
ArrayRef< Init * > getArgs() const
Definition: Record.h:1363
llvm::MapResolver::isComplete
bool isComplete(Init *VarName) const
Definition: Record.h:2044
llvm::Init
Definition: Record.h:271
llvm::BitRecTy::getAsString
std::string getAsString() const override
Definition: Record.h:114
llvm::DagInit::getArgNameStr
StringRef getArgNameStr(unsigned Num) const
Definition: Record.h:1358
llvm::Record::getValueAsBitOrUnset
bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const
This method looks up the specified field and returns its value as a bit.
Definition: Record.cpp:2620
llvm::RecTy::getListTy
ListRecTy * getListTy()
Returns the type representing list<thistype>.
Definition: Record.cpp:59
llvm::Init::IK_VarListElementInit
@ IK_VarListElementInit
Definition: Record.h:307
llvm::IsAOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:1565
llvm::MapResolver::MapResolver
MapResolver(Record *CurRec=nullptr)
Definition: Record.h:2040
llvm::RecordVal::getName
StringRef getName() const
Get the name of the field as a StringRef.
Definition: Record.cpp:2224
llvm::CondOpInit::name_begin
const_val_iterator name_begin() const
Definition: Record.h:992
llvm::RecordKeeper::stopTimer
void stopTimer()
Stop timing a phase.
Definition: Record.cpp:2703
FoldingSet.h
llvm::BitsInit::classof
static bool classof(const Init *I)
Definition: Record.h:514
llvm::RecordRecTy::classes_end
const_record_iterator classes_end() const
Definition: Record.h:253
llvm::Record::getValueAsInt
int64_t getValueAsInt(StringRef FieldName) const
This method looks up the specified field and returns its value as an int64_t, throwing an exception i...
Definition: Record.cpp:2535
llvm::DagInit::arg_begin
const_arg_iterator arg_begin() const
Definition: Record.h:1379
llvm::LessRecordRegister
Definition: Record.h:1915
llvm::BitsInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:349
llvm::DagInit::getNumArgs
unsigned getNumArgs() const
Definition: Record.h:1346
llvm::FieldInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.h:1299
llvm::VarBitInit::operator=
VarBitInit & operator=(const VarBitInit &)=delete
llvm::CondOpInit::getValType
RecTy * getValType() const
Definition: Record.h:953
llvm::LessRecordRegister::RecordParts::getPart
std::pair< bool, StringRef > getPart(size_t i)
Definition: Record.h:1942
llvm::HasReferenceResolver::resolve
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition: Record.cpp:2824
llvm::BitsInit::convertInitializerBitRange
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
Definition: Record.cpp:380
llvm::ListInit::getValues
ArrayRef< Init * > getValues() const
Definition: Record.h:715
llvm::UnsetInit
'?' - Represents an uninitialized value.
Definition: Record.h:439
llvm::CondOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:944
llvm::DagInit::get
static DagInit * get(Init *V, StringInit *VN, ArrayRef< Init * > ArgRange, ArrayRef< StringInit * > NameRange)
Definition: Record.cpp:2118
llvm::BinOpInit::getOperand
Init * getOperand(unsigned i) const override
Definition: Record.h:841
llvm::UnOpInit::SIZE
@ SIZE
Definition: Record.h:759
llvm::BinOpInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1152
llvm::DagInit::getNameStr
StringRef getNameStr() const
Definition: Record.h:1342
llvm::TernOpInit::getMHS
Init * getMHS() const
Definition: Record.h:908
llvm::LessRecordRegister::RecordParts
Definition: Record.h:1916
llvm::RecordVal::getType
RecTy * getType() const
Get the type of the field value as a RecTy.
Definition: Record.h:1447
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::UnOpInit::get
static UnOpInit * get(UnaryOp opc, Init *lhs, RecTy *Type)
Definition: Record.cpp:698
llvm::Init::IK_FirstOpInit
@ IK_FirstOpInit
Definition: Record.h:296
llvm::TimerGroup
The TimerGroup class is used to group together related timers into a single report that is printed wh...
Definition: Timer.h:176
llvm::RecordRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:237
llvm::BinOpInit::SRL
@ SRL
Definition: Record.h:808
llvm::StringInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.h:647
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
llvm::TernOpInit::FILTER
@ FILTER
Definition: Record.h:865
NC
#define NC
Definition: regutils.h:42
llvm::ListInit::end
const_iterator end() const
Definition: Record.h:720
llvm::Resolver::resolve
virtual Init * resolve(Init *VarName)=0
Return the initializer for the given variable name (should normally be a StringInit),...
llvm::BitsRecTy::get
static BitsRecTy * get(unsigned Sz)
Definition: Record.cpp:80
llvm::FieldInit::classof
static bool classof(const Init *I)
Definition: Record.h:1284
llvm::RecordVal::isNonconcreteOK
bool isNonconcreteOK() const
Is this a field where nonconcrete values are okay?
Definition: Record.h:1437
llvm::VarDefInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:1878
llvm::Record::getRecords
RecordKeeper & getRecords() const
Definition: Record.h:1676
llvm::BinOpInit::getOpcode
BinaryOp getOpcode() const
Definition: Record.h:849
llvm::Record::isAnonymous
bool isAnonymous() const
Definition: Record.h:1680
llvm::Record::getValue
const RecordVal * getValue(const Init *Name) const
Definition: Record.h:1585
llvm::VarInit::getNameInit
Init * getNameInit() const
Definition: Record.h:1090
llvm::StringInit::getValue
StringRef getValue() const
Definition: Record.h:639
llvm::FieldInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:1934
llvm::RecordResolver::resolve
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition: Record.cpp:2779
Casting.h
llvm::DagInit::name_empty
bool name_empty() const
Definition: Record.h:1389
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::CondOpInit::case_size
size_t case_size() const
Definition: Record.h:989
llvm::Init::IK_VarInit
@ IK_VarInit
Definition: Record.h:306
llvm::LessRecord::operator()
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition: Record.h:1892
llvm::VarBitInit::getBitNum
unsigned getBitNum() const
Definition: Record.h:1133
llvm::BitInit::operator=
BitInit & operator=(BitInit &)=delete
llvm::TrailingObjects
See the file comment for details on the usage of the TrailingObjects type.
Definition: TrailingObjects.h:212
llvm::UnOpInit::TAIL
@ TAIL
Definition: Record.h:759
llvm::ListRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:125
llvm::BinOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:822
llvm::BitsInit::get
static BitsInit * get(ArrayRef< Init * > Range)
Definition: Record.cpp:330
llvm::Record::getValueInit
Init * getValueInit(StringRef FieldName) const
Return the initializer for a value with the specified name, or throw an exception if the field does n...
Definition: Record.cpp:2465
llvm::UnOpInit::HEAD
@ HEAD
Definition: Record.h:759
llvm::Init::convertInitializerBitRange
virtual Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This function is used to implement the bit range selection operator.
Definition: Record.h:370
llvm::RecTy::StringRecTyKind
@ StringRecTyKind
Definition: Record.h:63
llvm::VarInit::classof
static bool classof(const Init *I)
Definition: Record.h:1082
llvm::ListRecTy::getAsString
std::string getAsString() const override
Definition: Record.cpp:121
llvm::DagInit::arg_end
const_arg_iterator arg_end() const
Definition: Record.h:1380
llvm::Init::print
void print(raw_ostream &OS) const
Print this value.
Definition: Record.h:343
llvm::RecordRecTy::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:189
llvm::CondOpInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:2097
llvm::tgtok::Class
@ Class
Definition: TGLexer.h:50
llvm::UnOpInit::clone
OpInit * clone(ArrayRef< Init * > Operands) const override
Definition: Record.h:780
llvm::VarInit::operator=
VarInit & operator=(const VarInit &)=delete
llvm::VarListElementInit::get
static VarListElementInit * get(TypedInit *T, unsigned E)
Definition: Record.cpp:1736
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:474
llvm::DefInit::operator=
DefInit & operator=(const DefInit &)=delete
llvm::UnsetInit::getCastTo
Init * getCastTo(RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
Definition: Record.cpp:291
llvm::RecTy::~RecTy
virtual ~RecTy()=default
llvm::LessRecordRegister::operator()
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition: Record.h:1948
llvm::RecordKeeper::saveInputFilename
void saveInputFilename(std::string Filename)
Definition: Record.h:1824
llvm::Record::isTemplateArg
bool isTemplateArg(Init *Name) const
Definition: Record.h:1581
llvm::UnsetInit::operator=
UnsetInit & operator=(const UnsetInit &)=delete
llvm::RecTy::typeIsConvertibleTo
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:65
llvm::CondOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:2019
llvm::RecordVal::getLoc
const SMLoc & getLoc() const
Get the source location of the point where the field was defined.
Definition: Record.h:1434
llvm::RecordRecTy::classes_begin
const_record_iterator classes_begin() const
Definition: Record.h:252
llvm::BinOpInit::LT
@ LT
Definition: Record.h:810
llvm::VarListElementInit::operator=
VarListElementInit & operator=(const VarListElementInit &)=delete
llvm::TernOpInit::FIND
@ FIND
Definition: Record.h:865
llvm::RecTy::getAsString
virtual std::string getAsString() const =0
llvm::Init::IK_ListInit
@ IK_ListInit
Definition: Record.h:295
SuperClass
llvm::PointerIntPair
PointerIntPair - This class implements a pair of a pointer and small integer.
Definition: PointerIntPair.h:45
llvm::BinOpInit::SETDAGOP
@ SETDAGOP
Definition: Record.h:810
llvm::VarDefInit::const_iterator
Init *const * const_iterator
Definition: Record.h:1248
llvm::RecordVal::RecordVal
RecordVal(Init *N, RecTy *T, FieldKind K)
Definition: Record.cpp:2210
llvm::RecTy::RecordRecTyKind
@ RecordRecTyKind
Definition: Record.h:66
SmallVector.h
llvm::RecTy::getRecTyKind
RecTyKind getRecTyKind() const
Definition: Record.h:78
llvm::Record::getName
StringRef getName() const
Definition: Record.h:1540
llvm::RecTy::BitRecTyKind
@ BitRecTyKind
Definition: Record.h:60
llvm::IntInit::operator=
IntInit & operator=(const IntInit &)=delete
llvm::ListInit::getElementAsRecord
Record * getElementAsRecord(unsigned i) const
Definition: Record.cpp:634
llvm::Record::appendLoc
void appendLoc(SMLoc Loc)
Definition: Record.h:1553
llvm::RecordResolver::keepUnsetBits
bool keepUnsetBits() const override
Definition: Record.h:2066
llvm::FoldOpInit::Fold
Init * Fold(Record *CurRec) const
Definition: Record.cpp:1504
llvm::SMRange
Represents a range in source code.
Definition: SMLoc.h:48
List
const NodeList & List
Definition: RDFGraph.cpp:201
llvm::UnOpInit::Fold
Init * Fold(Record *CurRec, bool IsFinal=false) const
Definition: Record.cpp:717
N
#define N
llvm::StringInit::determineFormat
static StringFormat determineFormat(StringFormat Fmt1, StringFormat Fmt2)
Definition: Record.h:635
llvm::Init::IK_LastOpInit
@ IK_LastOpInit
Definition: Record.h:300
llvm::Record::getValueAsBit
bool getValueAsBit(StringRef FieldName) const
This method looks up the specified field and returns its value as a bit, throwing an exception if the...
Definition: Record.cpp:2608
llvm::Record::appendAssertions
void appendAssertions(const Record *Rec)
Definition: Record.h:1630
llvm::tgtok::MultiClass
@ MultiClass
Definition: TGLexer.h:51
llvm::RecTy::RecTyKind
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
Definition: Record.h:59
llvm::VarBitInit
Opcode{0} - Represent access to one bit of a variable or field.
Definition: Record.h:1109
llvm::CondOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:1986
llvm::TrackUnresolvedResolver::foundUnresolved
bool foundUnresolved() const
Definition: Record.h:2099
llvm::BinOpInit::STRCONCAT
@ STRCONCAT
Definition: Record.h:809
llvm::VarBitInit::getBitVar
Init * getBitVar() const
Definition: Record.h:1132
llvm::TernOpInit::operator=
TernOpInit & operator=(const TernOpInit &)=delete
llvm::Record::getValueAsString
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
Definition: Record.cpp:2473
llvm::RecordKeeper::getNewAnonymousName
Init * getNewAnonymousName()
GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.
Definition: Record.cpp:2681
llvm::DagInit::getArgName
StringInit * getArgName(unsigned Num) const
Definition: Record.h:1353
llvm::tgtok::Bit
@ Bit
Definition: TGLexer.h:50
llvm::BitsRecTy::getAsString
std::string getAsString() const override
Definition: Record.cpp:90
llvm::UnOpInit::getOperand
Init * getOperand() const
Definition: Record.h:794
llvm::UnOpInit::EMPTY
@ EMPTY
Definition: Record.h:759
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:152
llvm::BinOpInit::MUL
@ MUL
Definition: Record.h:808
llvm::DagInit::name_end
const_name_iterator name_end() const
Definition: Record.h:1386
llvm::UnsetInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:461
llvm::CondOpInit::val_empty
bool val_empty() const
Definition: Record.h:996
llvm::MipsISD::Ins
@ Ins
Definition: MipsISelLowering.h:157
llvm::TernOpInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:915
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::VarDefInit::args_begin
const_iterator args_begin() const
Definition: Record.h:1250
llvm::StringInit::getFormat
StringFormat getFormat() const
Definition: Record.h:640
llvm::VarListElementInit::classof
static bool classof(const Init *I)
Definition: Record.h:1162
llvm::BitInit::classof
static bool classof(const Init *I)
Definition: Record.h:479
llvm::BinOpInit::LE
@ LE
Definition: Record.h:810
llvm::StringInit::StringFormat
StringFormat
Definition: Record.h:613
llvm::RecordResolver
Resolve all variables from a record except for unset variables.
Definition: Record.h:2054
llvm::RecordKeeper::addClass
void addClass(std::unique_ptr< Record > R)
Definition: Record.h:1828
llvm::StringInit::getAsUnquotedString
std::string getAsUnquotedString() const override
Convert this value to a literal form, without adding quotes around a string.
Definition: Record.h:654
llvm::DagInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:2164
llvm::UnOpInit::resolveReferences
Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition: Record.cpp:831
llvm::CondOpInit::case_empty
bool case_empty() const
Definition: Record.h:990
llvm::AnonymousNameInit::getValue
unsigned getValue() const
Definition: Record.h:597
llvm::BinOpInit::CONCAT
@ CONCAT
Definition: Record.h:809
llvm::VarDefInit::get
static VarDefInit * get(Record *Class, ArrayRef< Init * > Args)
Definition: Record.cpp:1803
llvm::BitsInit
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
Definition: Record.h:500
llvm::CondOpInit::operator=
CondOpInit & operator=(const CondOpInit &)=delete
llvm::LessRecordFieldName::operator()
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition: Record.h:1910
llvm::IsAOpInit::classof
static bool classof(const Init *I)
Definition: Record.h:1052
llvm::VarListElementInit
List[4] - Represent access to one element of a var or field.
Definition: Record.h:1146
llvm::TypedInit::classof
static bool classof(const Init *I)
Definition: Record.h:418
TemplateArgs
Definition: ItaniumDemangle.h:1198
llvm::VarInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:1700
llvm::AMDGPU::HSAMD::Kernel::Key::Args
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Definition: AMDGPUMetadata.h:389
llvm::VarDefInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.h:1258
llvm::VarDefInit::Fold
Init * Fold() const
Definition: Record.cpp:1899
llvm::Init::IK_BitInit
@ IK_BitInit
Definition: Record.h:289
llvm::DagRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:208
llvm::RecTy::IntRecTyKind
@ IntRecTyKind
Definition: Record.h:62
llvm::RecordKeeper::getDef
Record * getDef(StringRef Name) const
Get the concrete record with the specified name.
Definition: Record.h:1811
llvm::UnOpInit::getOpcode
UnaryOp getOpcode() const
Definition: Record.h:793
llvm::RecordKeeper::addExtraGlobal
void addExtraGlobal(StringRef Name, Init *I)
Definition: Record.h:1842
raw_ostream.h
llvm::TernOpInit::getOperand
Init * getOperand(unsigned i) const override
Definition: Record.h:897
llvm::RecordVal
This class represents a field in a record, including its name, type, value, and source location.
Definition: Record.h:1402
llvm::StringRef::size
LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:160
llvm::IntRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:107
llvm::RecordRecTy::isSubClassOf
bool isSubClassOf(Record *Class) const
Definition: Record.cpp:209
llvm::VarDefInit
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
Definition: Record.h:1213
llvm::UnOpInit::operator=
UnOpInit & operator=(const UnOpInit &)=delete
llvm::RecordRecTy::typeIsConvertibleTo
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Definition: Record.cpp:216
llvm::DagInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:2153
llvm::Record::getValueAsOptionalString
llvm::Optional< StringRef > getValueAsOptionalString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
Definition: Record.cpp:2482
llvm::RecordKeeper::dump
void dump() const
Definition: Record.cpp:2665
llvm::Init::IK_UnsetInit
@ IK_UnsetInit
Definition: Record.h:311
llvm::Record::setName
void setName(Init *Name)
Definition: Record.cpp:2327
llvm::Record::hasDirectSuperClass
bool hasDirectSuperClass(const Record *SuperClass) const
Determine whether this record has the specified direct superclass.
Definition: Record.cpp:2348
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::TypedInit::convertInitListSlice
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This function is used to implement the list slice selection operator.
Definition: Record.cpp:1662
llvm::Init::IK_LastTypedInit
@ IK_LastTypedInit
Definition: Record.h:310
llvm::ListInit::getElement
Init * getElement(unsigned i) const
Definition: Record.h:690
llvm::BitsInit::isComplete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition: Record.h:527
llvm::BinOpInit::getNumOperands
unsigned getNumOperands() const override
Definition: Record.h:840
llvm::Record::isValueUnset
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
Definition: Record.h:1698
llvm::DefInit::get
static DefInit * get(Record *)
Definition: Record.cpp:1774
llvm::BinOpInit::Profile
void Profile(FoldingSetNodeID &ID) const
Definition: Record.cpp:879
llvm::VarDefInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1912
llvm::Record::getValue
RecordVal * getValue(const Init *Name)
Definition: Record.h:1595
llvm::Record::getValueAsDef
Record * getValueAsDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, throwing an exception if ...
Definition: Record.cpp:2581
llvm::Init::IK_IsAOpInit
@ IK_IsAOpInit
Definition: Record.h:303
llvm::LessRecordRegister::RecordParts::RecordParts
RecordParts(StringRef Rec)
Definition: Record.h:1919
llvm::StringRecTy::classof
static bool classof(const RecTy *RT)
Definition: Record.h:166
llvm::Resolver::isFinal
bool isFinal() const
Definition: Record.h:2022
llvm::HasReferenceResolver::HasReferenceResolver
HasReferenceResolver(Init *VarNameToTrack)
Definition: Record.h:2111
llvm::BitInit::get
static BitInit * get(bool V)
Definition: Record.cpp:299
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38
llvm::RecordKeeper::getGlobals
const GlobalMap & getGlobals() const
Get the map of global variables.
Definition: Record.h:1802
llvm::StringRecTy::get
static StringRecTy * get()
Definition: Record.h:170
llvm::TypedInit
This is the common superclass of types that have a specific, explicit type, stored in ValueTy.
Definition: Record.h:407
llvm::FoldOpInit::getBit
Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition: Record.cpp:1533
llvm::VarListElementInit::getAsString
std::string getAsString() const override
Convert this value to a literal form.
Definition: Record.cpp:1748