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