LLVM  14.0.0git
DerivedTypes.h
Go to the documentation of this file.
1 //===- llvm/DerivedTypes.h - Classes for handling data types ----*- 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 contains the declarations of classes that represent "derived
10 // types". These are things like "arrays of x" or "structure of x, y, z" or
11 // "function returning x taking (y,z) as parameters", etc...
12 //
13 // The implementations of these classes live in the Type.cpp file.
14 //
15 //===----------------------------------------------------------------------===//
16 
17 #ifndef LLVM_IR_DERIVEDTYPES_H
18 #define LLVM_IR_DERIVEDTYPES_H
19 
20 #include "llvm/ADT/ArrayRef.h"
21 #include "llvm/ADT/STLExtras.h"
22 #include "llvm/ADT/StringRef.h"
23 #include "llvm/IR/Type.h"
24 #include "llvm/Support/Casting.h"
25 #include "llvm/Support/Compiler.h"
26 #include "llvm/Support/TypeSize.h"
27 #include <cassert>
28 #include <cstdint>
29 
30 namespace llvm {
31 
32 class Value;
33 class APInt;
34 class LLVMContext;
35 
36 /// Class to represent integer types. Note that this class is also used to
37 /// represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and
38 /// Int64Ty.
39 /// Integer representation type
40 class IntegerType : public Type {
41  friend class LLVMContextImpl;
42 
43 protected:
44  explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
45  setSubclassData(NumBits);
46  }
47 
48 public:
49  /// This enum is just used to hold constants we need for IntegerType.
50  enum {
51  MIN_INT_BITS = 1, ///< Minimum number of bits that can be specified
52  MAX_INT_BITS = (1<<24)-1 ///< Maximum number of bits that can be specified
53  ///< Note that bit width is stored in the Type classes SubclassData field
54  ///< which has 24 bits. This yields a maximum bit width of 16,777,215
55  ///< bits.
56  };
57 
58  /// This static method is the primary way of constructing an IntegerType.
59  /// If an IntegerType with the same NumBits value was previously instantiated,
60  /// that instance will be returned. Otherwise a new one will be created. Only
61  /// one instance with a given NumBits value is ever created.
62  /// Get or create an IntegerType instance.
63  static IntegerType *get(LLVMContext &C, unsigned NumBits);
64 
65  /// Returns type twice as wide the input type.
68  }
69 
70  /// Get the number of bits in this IntegerType
71  unsigned getBitWidth() const { return getSubclassData(); }
72 
73  /// Return a bitmask with ones set for all of the bits that can be set by an
74  /// unsigned version of this type. This is 0xFF for i8, 0xFFFF for i16, etc.
75  uint64_t getBitMask() const {
76  return ~uint64_t(0UL) >> (64-getBitWidth());
77  }
78 
79  /// Return a uint64_t with just the most significant bit set (the sign bit, if
80  /// the value is treated as a signed number).
81  uint64_t getSignBit() const {
82  return 1ULL << (getBitWidth()-1);
83  }
84 
85  /// For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
86  /// @returns a bit mask with ones set for all the bits of this type.
87  /// Get a bit mask for this type.
88  APInt getMask() const;
89 
90  /// Methods for support type inquiry through isa, cast, and dyn_cast.
91  static bool classof(const Type *T) {
92  return T->getTypeID() == IntegerTyID;
93  }
94 };
95 
96 unsigned Type::getIntegerBitWidth() const {
97  return cast<IntegerType>(this)->getBitWidth();
98 }
99 
100 /// Class to represent function types
101 ///
102 class FunctionType : public Type {
103  FunctionType(Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
104 
105 public:
106  FunctionType(const FunctionType &) = delete;
107  FunctionType &operator=(const FunctionType &) = delete;
108 
109  /// This static method is the primary way of constructing a FunctionType.
110  static FunctionType *get(Type *Result,
111  ArrayRef<Type*> Params, bool isVarArg);
112 
113  /// Create a FunctionType taking no parameters.
114  static FunctionType *get(Type *Result, bool isVarArg);
115 
116  /// Return true if the specified type is valid as a return type.
117  static bool isValidReturnType(Type *RetTy);
118 
119  /// Return true if the specified type is valid as an argument type.
120  static bool isValidArgumentType(Type *ArgTy);
121 
122  bool isVarArg() const { return getSubclassData()!=0; }
123  Type *getReturnType() const { return ContainedTys[0]; }
124 
126 
127  param_iterator param_begin() const { return ContainedTys + 1; }
130  return makeArrayRef(param_begin(), param_end());
131  }
132 
133  /// Parameter type accessors.
134  Type *getParamType(unsigned i) const { return ContainedTys[i+1]; }
135 
136  /// Return the number of fixed parameters this function type requires.
137  /// This does not consider varargs.
138  unsigned getNumParams() const { return NumContainedTys - 1; }
139 
140  /// Methods for support type inquiry through isa, cast, and dyn_cast.
141  static bool classof(const Type *T) {
142  return T->getTypeID() == FunctionTyID;
143  }
144 };
145 static_assert(alignof(FunctionType) >= alignof(Type *),
146  "Alignment sufficient for objects appended to FunctionType");
147 
149  return cast<FunctionType>(this)->isVarArg();
150 }
151 
153  return cast<FunctionType>(this)->getParamType(i);
154 }
155 
156 unsigned Type::getFunctionNumParams() const {
157  return cast<FunctionType>(this)->getNumParams();
158 }
159 
160 /// A handy container for a FunctionType+Callee-pointer pair, which can be
161 /// passed around as a single entity. This assists in replacing the use of
162 /// PointerType::getElementType() to access the function's type, since that's
163 /// slated for removal as part of the [opaque pointer types] project.
165 public:
166  // Allow implicit conversion from types which have a getFunctionType member
167  // (e.g. Function and InlineAsm).
168  template <typename T, typename U = decltype(&T::getFunctionType)>
170  : FnTy(Fn ? Fn->getFunctionType() : nullptr), Callee(Fn) {}
171 
173  : FnTy(FnTy), Callee(Callee) {
174  assert((FnTy == nullptr) == (Callee == nullptr));
175  }
176 
177  FunctionCallee(std::nullptr_t) {}
178 
179  FunctionCallee() = default;
180 
181  FunctionType *getFunctionType() { return FnTy; }
182 
183  Value *getCallee() { return Callee; }
184 
185  explicit operator bool() { return Callee; }
186 
187 private:
188  FunctionType *FnTy = nullptr;
189  Value *Callee = nullptr;
190 };
191 
192 /// Class to represent struct types. There are two different kinds of struct
193 /// types: Literal structs and Identified structs.
194 ///
195 /// Literal struct types (e.g. { i32, i32 }) are uniqued structurally, and must
196 /// always have a body when created. You can get one of these by using one of
197 /// the StructType::get() forms.
198 ///
199 /// Identified structs (e.g. %foo or %42) may optionally have a name and are not
200 /// uniqued. The names for identified structs are managed at the LLVMContext
201 /// level, so there can only be a single identified struct with a given name in
202 /// a particular LLVMContext. Identified structs may also optionally be opaque
203 /// (have no body specified). You get one of these by using one of the
204 /// StructType::create() forms.
205 ///
206 /// Independent of what kind of struct you have, the body of a struct type are
207 /// laid out in memory consecutively with the elements directly one after the
208 /// other (if the struct is packed) or (if not packed) with padding between the
209 /// elements as defined by DataLayout (which is required to match what the code
210 /// generator for a target expects).
211 ///
212 class StructType : public Type {
214 
215  enum {
216  /// This is the contents of the SubClassData field.
217  SCDB_HasBody = 1,
218  SCDB_Packed = 2,
219  SCDB_IsLiteral = 4,
220  SCDB_IsSized = 8
221  };
222 
223  /// For a named struct that actually has a name, this is a pointer to the
224  /// symbol table entry (maintained by LLVMContext) for the struct.
225  /// This is null if the type is an literal struct or if it is a identified
226  /// type that has an empty name.
227  void *SymbolTableEntry = nullptr;
228 
229 public:
230  StructType(const StructType &) = delete;
231  StructType &operator=(const StructType &) = delete;
232 
233  /// This creates an identified struct.
236 
237  static StructType *create(ArrayRef<Type *> Elements, StringRef Name,
238  bool isPacked = false);
239  static StructType *create(ArrayRef<Type *> Elements);
241  StringRef Name, bool isPacked = false);
243  template <class... Tys>
244  static std::enable_if_t<are_base_of<Type, Tys...>::value, StructType *>
245  create(StringRef Name, Type *elt1, Tys *... elts) {
246  assert(elt1 && "Cannot create a struct type with no elements with this");
247  return create(ArrayRef<Type *>({elt1, elts...}), Name);
248  }
249 
250  /// This static method is the primary way to create a literal StructType.
251  static StructType *get(LLVMContext &Context, ArrayRef<Type*> Elements,
252  bool isPacked = false);
253 
254  /// Create an empty structure type.
255  static StructType *get(LLVMContext &Context, bool isPacked = false);
256 
257  /// This static method is a convenience method for creating structure types by
258  /// specifying the elements as arguments. Note that this method always returns
259  /// a non-packed struct, and requires at least one element type.
260  template <class... Tys>
261  static std::enable_if_t<are_base_of<Type, Tys...>::value, StructType *>
262  get(Type *elt1, Tys *... elts) {
263  assert(elt1 && "Cannot create a struct type with no elements with this");
264  LLVMContext &Ctx = elt1->getContext();
265  return StructType::get(Ctx, ArrayRef<Type *>({elt1, elts...}));
266  }
267 
268  /// Return the type with the specified name, or null if there is none by that
269  /// name.
271 
272  bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
273 
274  /// Return true if this type is uniqued by structural equivalence, false if it
275  /// is a struct definition.
276  bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
277 
278  /// Return true if this is a type with an identity that has no body specified
279  /// yet. These prints as 'opaque' in .ll files.
280  bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
281 
282  /// isSized - Return true if this is a sized type.
283  bool isSized(SmallPtrSetImpl<Type *> *Visited = nullptr) const;
284 
285  /// Returns true if this struct contains a scalable vector.
286  bool containsScalableVectorType() const;
287 
288  /// Return true if this is a named struct that has a non-empty name.
289  bool hasName() const { return SymbolTableEntry != nullptr; }
290 
291  /// Return the name for this struct type if it has an identity.
292  /// This may return an empty string for an unnamed struct type. Do not call
293  /// this on an literal type.
294  StringRef getName() const;
295 
296  /// Change the name of this type to the specified name, or to a name with a
297  /// suffix if there is a collision. Do not call this on an literal type.
298  void setName(StringRef Name);
299 
300  /// Specify a body for an opaque identified type.
301  void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
302 
303  template <typename... Tys>
304  std::enable_if_t<are_base_of<Type, Tys...>::value, void>
305  setBody(Type *elt1, Tys *... elts) {
306  assert(elt1 && "Cannot create a struct type with no elements with this");
307  setBody(ArrayRef<Type *>({elt1, elts...}));
308  }
309 
310  /// Return true if the specified type is valid as a element type.
311  static bool isValidElementType(Type *ElemTy);
312 
313  // Iterator access to the elements.
315 
320  }
321 
322  /// Return true if this is layout identical to the specified struct.
323  bool isLayoutIdentical(StructType *Other) const;
324 
325  /// Random access to the elements
326  unsigned getNumElements() const { return NumContainedTys; }
327  Type *getElementType(unsigned N) const {
328  assert(N < NumContainedTys && "Element number out of range!");
329  return ContainedTys[N];
330  }
331  /// Given an index value into the type, return the type of the element.
332  Type *getTypeAtIndex(const Value *V) const;
333  Type *getTypeAtIndex(unsigned N) const { return getElementType(N); }
334  bool indexValid(const Value *V) const;
335  bool indexValid(unsigned Idx) const { return Idx < getNumElements(); }
336 
337  /// Methods for support type inquiry through isa, cast, and dyn_cast.
338  static bool classof(const Type *T) {
339  return T->getTypeID() == StructTyID;
340  }
341 };
342 
344  return cast<StructType>(this)->getName();
345 }
346 
347 unsigned Type::getStructNumElements() const {
348  return cast<StructType>(this)->getNumElements();
349 }
350 
352  return cast<StructType>(this)->getElementType(N);
353 }
354 
355 /// Class to represent array types.
356 class ArrayType : public Type {
357  /// The element type of the array.
358  Type *ContainedType;
359  /// Number of elements in the array.
360  uint64_t NumElements;
361 
362  ArrayType(Type *ElType, uint64_t NumEl);
363 
364 public:
365  ArrayType(const ArrayType &) = delete;
366  ArrayType &operator=(const ArrayType &) = delete;
367 
368  uint64_t getNumElements() const { return NumElements; }
369  Type *getElementType() const { return ContainedType; }
370 
371  /// This static method is the primary way to construct an ArrayType
372  static ArrayType *get(Type *ElementType, uint64_t NumElements);
373 
374  /// Return true if the specified type is valid as a element type.
375  static bool isValidElementType(Type *ElemTy);
376 
377  /// Methods for support type inquiry through isa, cast, and dyn_cast.
378  static bool classof(const Type *T) {
379  return T->getTypeID() == ArrayTyID;
380  }
381 };
382 
383 uint64_t Type::getArrayNumElements() const {
384  return cast<ArrayType>(this)->getNumElements();
385 }
386 
387 /// Base class of all SIMD vector types
388 class VectorType : public Type {
389  /// A fully specified VectorType is of the form <vscale x n x Ty>. 'n' is the
390  /// minimum number of elements of type Ty contained within the vector, and
391  /// 'vscale x' indicates that the total element count is an integer multiple
392  /// of 'n', where the multiple is either guaranteed to be one, or is
393  /// statically unknown at compile time.
394  ///
395  /// If the multiple is known to be 1, then the extra term is discarded in
396  /// textual IR:
397  ///
398  /// <4 x i32> - a vector containing 4 i32s
399  /// <vscale x 4 x i32> - a vector containing an unknown integer multiple
400  /// of 4 i32s
401 
402  /// The element type of the vector.
403  Type *ContainedType;
404 
405 protected:
406  /// The element quantity of this vector. The meaning of this value depends
407  /// on the type of vector:
408  /// - For FixedVectorType = <ElementQuantity x ty>, there are
409  /// exactly ElementQuantity elements in this vector.
410  /// - For ScalableVectorType = <vscale x ElementQuantity x ty>,
411  /// there are vscale * ElementQuantity elements in this vector, where
412  /// vscale is a runtime-constant integer greater than 0.
413  const unsigned ElementQuantity;
414 
415  VectorType(Type *ElType, unsigned EQ, Type::TypeID TID);
416 
417 public:
418  VectorType(const VectorType &) = delete;
419  VectorType &operator=(const VectorType &) = delete;
420 
421  Type *getElementType() const { return ContainedType; }
422 
423  /// This static method is the primary way to construct an VectorType.
424  static VectorType *get(Type *ElementType, ElementCount EC);
425 
426  static VectorType *get(Type *ElementType, unsigned NumElements,
427  bool Scalable) {
428  return VectorType::get(ElementType,
429  ElementCount::get(NumElements, Scalable));
430  }
431 
432  static VectorType *get(Type *ElementType, const VectorType *Other) {
433  return VectorType::get(ElementType, Other->getElementCount());
434  }
435 
436  /// This static method gets a VectorType with the same number of elements as
437  /// the input type, and the element type is an integer type of the same width
438  /// as the input element type.
440  unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
441  assert(EltBits && "Element size must be of a non-zero size");
442  Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
443  return VectorType::get(EltTy, VTy->getElementCount());
444  }
445 
446  /// This static method is like getInteger except that the element types are
447  /// twice as wide as the elements in the input type.
449  assert(VTy->isIntOrIntVectorTy() && "VTy expected to be a vector of ints.");
450  auto *EltTy = cast<IntegerType>(VTy->getElementType());
451  return VectorType::get(EltTy->getExtendedType(), VTy->getElementCount());
452  }
453 
454  // This static method gets a VectorType with the same number of elements as
455  // the input type, and the element type is an integer or float type which
456  // is half as wide as the elements in the input type.
458  Type *EltTy;
459  if (VTy->getElementType()->isFloatingPointTy()) {
460  switch(VTy->getElementType()->getTypeID()) {
461  case DoubleTyID:
462  EltTy = Type::getFloatTy(VTy->getContext());
463  break;
464  case FloatTyID:
465  EltTy = Type::getHalfTy(VTy->getContext());
466  break;
467  default:
468  llvm_unreachable("Cannot create narrower fp vector element type");
469  }
470  } else {
471  unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
472  assert((EltBits & 1) == 0 &&
473  "Cannot truncate vector element with odd bit-width");
474  EltTy = IntegerType::get(VTy->getContext(), EltBits / 2);
475  }
476  return VectorType::get(EltTy, VTy->getElementCount());
477  }
478 
479  // This static method returns a VectorType with a smaller number of elements
480  // of a larger type than the input element type. For example, a <16 x i8>
481  // subdivided twice would return <4 x i32>
482  static VectorType *getSubdividedVectorType(VectorType *VTy, int NumSubdivs) {
483  for (int i = 0; i < NumSubdivs; ++i) {
486  }
487  return VTy;
488  }
489 
490  /// This static method returns a VectorType with half as many elements as the
491  /// input type and the same element type.
493  auto EltCnt = VTy->getElementCount();
494  assert(EltCnt.isKnownEven() &&
495  "Cannot halve vector with odd number of elements.");
496  return VectorType::get(VTy->getElementType(),
497  EltCnt.divideCoefficientBy(2));
498  }
499 
500  /// This static method returns a VectorType with twice as many elements as the
501  /// input type and the same element type.
503  auto EltCnt = VTy->getElementCount();
504  assert((EltCnt.getKnownMinValue() * 2ull) <= UINT_MAX &&
505  "Too many elements in vector");
506  return VectorType::get(VTy->getElementType(), EltCnt * 2);
507  }
508 
509  /// Return true if the specified type is valid as a element type.
510  static bool isValidElementType(Type *ElemTy);
511 
512  /// Return an ElementCount instance to represent the (possibly scalable)
513  /// number of elements in the vector.
514  inline ElementCount getElementCount() const;
515 
516  /// Methods for support type inquiry through isa, cast, and dyn_cast.
517  static bool classof(const Type *T) {
518  return T->getTypeID() == FixedVectorTyID ||
519  T->getTypeID() == ScalableVectorTyID;
520  }
521 };
522 
523 /// Class to represent fixed width SIMD vectors
524 class FixedVectorType : public VectorType {
525 protected:
526  FixedVectorType(Type *ElTy, unsigned NumElts)
527  : VectorType(ElTy, NumElts, FixedVectorTyID) {}
528 
529 public:
530  static FixedVectorType *get(Type *ElementType, unsigned NumElts);
531 
532  static FixedVectorType *get(Type *ElementType, const FixedVectorType *FVTy) {
533  return get(ElementType, FVTy->getNumElements());
534  }
535 
537  return cast<FixedVectorType>(VectorType::getInteger(VTy));
538  }
539 
541  return cast<FixedVectorType>(VectorType::getExtendedElementVectorType(VTy));
542  }
543 
545  return cast<FixedVectorType>(
547  }
548 
550  int NumSubdivs) {
551  return cast<FixedVectorType>(
552  VectorType::getSubdividedVectorType(VTy, NumSubdivs));
553  }
554 
556  return cast<FixedVectorType>(VectorType::getHalfElementsVectorType(VTy));
557  }
558 
560  return cast<FixedVectorType>(VectorType::getDoubleElementsVectorType(VTy));
561  }
562 
563  static bool classof(const Type *T) {
564  return T->getTypeID() == FixedVectorTyID;
565  }
566 
567  unsigned getNumElements() const { return ElementQuantity; }
568 };
569 
570 /// Class to represent scalable SIMD vectors
572 protected:
573  ScalableVectorType(Type *ElTy, unsigned MinNumElts)
574  : VectorType(ElTy, MinNumElts, ScalableVectorTyID) {}
575 
576 public:
577  static ScalableVectorType *get(Type *ElementType, unsigned MinNumElts);
578 
579  static ScalableVectorType *get(Type *ElementType,
580  const ScalableVectorType *SVTy) {
581  return get(ElementType, SVTy->getMinNumElements());
582  }
583 
585  return cast<ScalableVectorType>(VectorType::getInteger(VTy));
586  }
587 
588  static ScalableVectorType *
590  return cast<ScalableVectorType>(
592  }
593 
594  static ScalableVectorType *
596  return cast<ScalableVectorType>(
598  }
599 
601  int NumSubdivs) {
602  return cast<ScalableVectorType>(
603  VectorType::getSubdividedVectorType(VTy, NumSubdivs));
604  }
605 
606  static ScalableVectorType *
608  return cast<ScalableVectorType>(VectorType::getHalfElementsVectorType(VTy));
609  }
610 
611  static ScalableVectorType *
613  return cast<ScalableVectorType>(
615  }
616 
617  /// Get the minimum number of elements in this vector. The actual number of
618  /// elements in the vector is an integer multiple of this value.
619  uint64_t getMinNumElements() const { return ElementQuantity; }
620 
621  static bool classof(const Type *T) {
622  return T->getTypeID() == ScalableVectorTyID;
623  }
624 };
625 
627  return ElementCount::get(ElementQuantity, isa<ScalableVectorType>(this));
628 }
629 
630 /// Class to represent pointers.
631 class PointerType : public Type {
632  explicit PointerType(Type *ElType, unsigned AddrSpace);
633  explicit PointerType(LLVMContext &C, unsigned AddrSpace);
634 
635  Type *PointeeTy;
636 
637 public:
638  PointerType(const PointerType &) = delete;
639  PointerType &operator=(const PointerType &) = delete;
640 
641  /// This constructs a pointer to an object of the specified type in a numbered
642  /// address space.
643  static PointerType *get(Type *ElementType, unsigned AddressSpace);
644  /// This constructs an opaque pointer to an object in a numbered address
645  /// space.
646  static PointerType *get(LLVMContext &C, unsigned AddressSpace);
647 
648  /// This constructs a pointer to an object of the specified type in the
649  /// default address space (address space zero).
650  static PointerType *getUnqual(Type *ElementType) {
651  return PointerType::get(ElementType, 0);
652  }
653 
654  /// This constructs an opaque pointer to an object in the
655  /// default address space (address space zero).
657  return PointerType::get(C, 0);
658  }
659 
660  /// This constructs a pointer type with the same pointee type as input
661  /// PointerType (or opaque pointer is the input PointerType is opaque) and the
662  /// given address space. This is only useful during the opaque pointer
663  /// transition.
664  /// TODO: remove after opaque pointer transition is complete.
666  unsigned AddressSpace) {
667  if (PT->isOpaque())
668  return get(PT->getContext(), AddressSpace);
669  return get(PT->getElementType(), AddressSpace);
670  }
671 
672  Type *getElementType() const {
673  assert(!isOpaque() && "Attempting to get element type of opaque pointer");
674  return PointeeTy;
675  }
676 
677  bool isOpaque() const { return !PointeeTy; }
678 
679  /// Return true if the specified type is valid as a element type.
680  static bool isValidElementType(Type *ElemTy);
681 
682  /// Return true if we can load or store from a pointer to this type.
683  static bool isLoadableOrStorableType(Type *ElemTy);
684 
685  /// Return the address space of the Pointer type.
686  inline unsigned getAddressSpace() const { return getSubclassData(); }
687 
688  /// Return true if either this is an opaque pointer type or if this pointee
689  /// type matches Ty. Primarily used for checking if an instruction's pointer
690  /// operands are valid types. Will be useless after non-opaque pointers are
691  /// removed.
693  return isOpaque() || PointeeTy == Ty;
694  }
695 
696  /// Return true if both pointer types have the same element type. Two opaque
697  /// pointers are considered to have the same element type, while an opaque
698  /// and a non-opaque pointer have different element types.
699  /// TODO: Remove after opaque pointer transition is complete.
701  return PointeeTy == Other->PointeeTy;
702  }
703 
704  /// Implement support type inquiry through isa, cast, and dyn_cast.
705  static bool classof(const Type *T) {
706  return T->getTypeID() == PointerTyID;
707  }
708 };
709 
711  assert(
712  isIntOrIntVectorTy() &&
713  "Original type expected to be a vector of integers or a scalar integer.");
714  if (auto *VTy = dyn_cast<VectorType>(this))
716  const_cast<VectorType *>(VTy));
717  return cast<IntegerType>(this)->getExtendedType();
718 }
719 
721  if (auto *VTy = dyn_cast<VectorType>(this))
722  return VectorType::get(EltTy, VTy->getElementCount());
723  return EltTy;
724 }
725 
726 Type *Type::getWithNewBitWidth(unsigned NewBitWidth) const {
727  assert(
728  isIntOrIntVectorTy() &&
729  "Original type expected to be a vector of integers or a scalar integer.");
730  return getWithNewType(getIntNTy(getContext(), NewBitWidth));
731 }
732 
734  return cast<PointerType>(getScalarType())->getAddressSpace();
735 }
736 
737 } // end namespace llvm
738 
739 #endif // LLVM_IR_DERIVEDTYPES_H
i
i
Definition: README.txt:29
llvm::Type::isFunctionVarArg
bool isFunctionVarArg() const
Definition: DerivedTypes.h:148
llvm::Type::ArrayTyID
@ ArrayTyID
Arrays.
Definition: Type.h:75
llvm::ScalableVectorType::getInteger
static ScalableVectorType * getInteger(ScalableVectorType *VTy)
Definition: DerivedTypes.h:584
llvm::Type::FloatTyID
@ FloatTyID
32-bit floating point type
Definition: Type.h:58
llvm::ScalableVectorType
Class to represent scalable SIMD vectors.
Definition: DerivedTypes.h:571
llvm::VectorType::getSubdividedVectorType
static VectorType * getSubdividedVectorType(VectorType *VTy, int NumSubdivs)
Definition: DerivedTypes.h:482
llvm::Type::DoubleTyID
@ DoubleTyID
64-bit floating point type
Definition: Type.h:59
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::PointerType::isValidElementType
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:742
llvm::StructType::getName
StringRef getName() const
Return the name for this struct type if it has an identity.
Definition: Type.cpp:547
llvm::StructType::get
static StructType * get(LLVMContext &Context, ArrayRef< Type * > Elements, bool isPacked=false)
This static method is the primary way to create a literal StructType.
Definition: Type.cpp:372
llvm::Type::getFunctionNumParams
unsigned getFunctionNumParams() const
Definition: DerivedTypes.h:156
FunctionType
Definition: ItaniumDemangle.h:643
llvm::ElementCount
Definition: TypeSize.h:386
llvm::VectorType::classof
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:517
llvm::PointerType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:672
StringRef.h
llvm::VectorType::getDoubleElementsVectorType
static VectorType * getDoubleElementsVectorType(VectorType *VTy)
This static method returns a VectorType with twice as many elements as the input type and the same el...
Definition: DerivedTypes.h:502
llvm::PointerType::get
static PointerType * get(Type *ElementType, unsigned AddressSpace)
This constructs a pointer to an object of the specified type in a numbered address space.
Definition: Type.cpp:693
llvm::StructType::element_iterator
Type::subtype_iterator element_iterator
Definition: DerivedTypes.h:314
llvm::StructType::setBody
void setBody(ArrayRef< Type * > Elements, bool isPacked=false)
Specify a body for an opaque identified type.
Definition: Type.cpp:411
llvm::Type::getScalarType
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
Definition: Type.h:319
TypeSize.h
llvm::VectorType::ElementQuantity
const unsigned ElementQuantity
The element quantity of this vector.
Definition: DerivedTypes.h:413
llvm::StructType::get
static std::enable_if_t< are_base_of< Type, Tys... >::value, StructType * > get(Type *elt1, Tys *... elts)
This static method is a convenience method for creating structure types by specifying the elements as...
Definition: DerivedTypes.h:262
llvm::Type::getPointerAddressSpace
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition: DerivedTypes.h:733
llvm::PointerType::getAddressSpace
unsigned getAddressSpace() const
Return the address space of the Pointer type.
Definition: DerivedTypes.h:686
llvm::FunctionType::get
static FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Definition: Type.cpp:327
llvm::Type::getSubclassData
unsigned getSubclassData() const
Definition: Type.h:96
llvm::Type::getTypeID
TypeID getTypeID() const
Return the type id for the type.
Definition: Type.h:135
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::FunctionCallee::FunctionCallee
FunctionCallee(FunctionType *FnTy, Value *Callee)
Definition: DerivedTypes.h:172
llvm::StructType::getTypeByName
static StructType * getTypeByName(LLVMContext &C, StringRef Name)
Return the type with the specified name, or null if there is none by that name.
Definition: Type.cpp:589
llvm::IntegerType::getBitMask
uint64_t getBitMask() const
Return a bitmask with ones set for all of the bits that can be set by an unsigned version of this typ...
Definition: DerivedTypes.h:75
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::StructType::indexValid
bool indexValid(unsigned Idx) const
Definition: DerivedTypes.h:335
llvm::VectorType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:421
llvm::FunctionType::getNumParams
unsigned getNumParams() const
Return the number of fixed parameters this function type requires.
Definition: DerivedTypes.h:138
STLExtras.h
llvm::Type::subtype_iterator
Type *const * subtype_iterator
Definition: Type.h:328
llvm::ArrayType
Class to represent array types.
Definition: DerivedTypes.h:356
llvm::StructType::create
static StructType * create(LLVMContext &Context, StringRef Name)
This creates an identified struct.
Definition: Type.cpp:479
llvm::ScalableVectorType::ScalableVectorType
ScalableVectorType(Type *ElTy, unsigned MinNumElts)
Definition: DerivedTypes.h:573
llvm::Type::isFloatingPointTy
bool isFloatingPointTy() const
Return true if this is one of the six floating-point types.
Definition: Type.h:162
llvm::PointerType::getUnqual
static PointerType * getUnqual(LLVMContext &C)
This constructs an opaque pointer to an object in the default address space (address space zero).
Definition: DerivedTypes.h:656
llvm::FixedVectorType
Class to represent fixed width SIMD vectors.
Definition: DerivedTypes.h:524
llvm::StructType::setName
void setName(StringRef Name)
Change the name of this type to the specified name, or to a name with a suffix if there is a collisio...
Definition: Type.cpp:428
llvm::Type::getWithNewType
Type * getWithNewType(Type *EltTy) const
Given vector type, change the element type, whilst keeping the old number of elements.
Definition: DerivedTypes.h:720
llvm::IntegerType::getExtendedType
IntegerType * getExtendedType() const
Returns type twice as wide the input type.
Definition: DerivedTypes.h:66
llvm::FunctionType::isVarArg
bool isVarArg() const
Definition: DerivedTypes.h:122
llvm::IntegerType::getMask
APInt getMask() const
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
Definition: Type.cpp:299
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::conjunction
Definition: STLForwardCompat.h:32
llvm::FixedVectorType::getTruncatedElementVectorType
static FixedVectorType * getTruncatedElementVectorType(FixedVectorType *VTy)
Definition: DerivedTypes.h:544
llvm::FunctionType::operator=
FunctionType & operator=(const FunctionType &)=delete
llvm::PointerType::operator=
PointerType & operator=(const PointerType &)=delete
llvm::FixedVectorType::getNumElements
unsigned getNumElements() const
Definition: DerivedTypes.h:567
llvm::PointerType::isOpaqueOrPointeeTypeMatches
bool isOpaqueOrPointeeTypeMatches(Type *Ty)
Return true if either this is an opaque pointer type or if this pointee type matches Ty.
Definition: DerivedTypes.h:692
llvm::VectorType::getTruncatedElementVectorType
static VectorType * getTruncatedElementVectorType(VectorType *VTy)
Definition: DerivedTypes.h:457
llvm::LinearPolySize< ElementCount >::get
static ElementCount get(ScalarTy MinVal, bool Scalable)
Definition: TypeSize.h:290
llvm::Type::FunctionTyID
@ FunctionTyID
Functions.
Definition: Type.h:72
llvm::ArrayType::getNumElements
uint64_t getNumElements() const
Definition: DerivedTypes.h:368
llvm::ScalableVectorType::getDoubleElementsVectorType
static ScalableVectorType * getDoubleElementsVectorType(ScalableVectorType *VTy)
Definition: DerivedTypes.h:612
llvm::ScalableVectorType::getTruncatedElementVectorType
static ScalableVectorType * getTruncatedElementVectorType(ScalableVectorType *VTy)
Definition: DerivedTypes.h:595
llvm::FixedVectorType::FixedVectorType
FixedVectorType(Type *ElTy, unsigned NumElts)
Definition: DerivedTypes.h:526
llvm::StructType::isPacked
bool isPacked() const
Definition: DerivedTypes.h:272
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::LLVMContextImpl
Definition: LLVMContextImpl.h:1324
llvm::FunctionType::param_end
param_iterator param_end() const
Definition: DerivedTypes.h:128
llvm::StructType::isSized
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
isSized - Return true if this is a sized type.
Definition: Type.cpp:518
EQ
#define EQ(a, b)
Definition: regexec.c:112
llvm::VectorType::getInteger
static VectorType * getInteger(VectorType *VTy)
This static method gets a VectorType with the same number of elements as the input type,...
Definition: DerivedTypes.h:439
llvm::Type::getStructName
StringRef getStructName() const
Definition: DerivedTypes.h:343
llvm::FixedVectorType::get
static FixedVectorType * get(Type *ElementType, const FixedVectorType *FVTy)
Definition: DerivedTypes.h:532
llvm::FunctionType::isValidReturnType
static bool isValidReturnType(Type *RetTy)
Return true if the specified type is valid as a return type.
Definition: Type.cpp:357
llvm::IntegerType::IntegerType
IntegerType(LLVMContext &C, unsigned NumBits)
Definition: DerivedTypes.h:44
llvm::VectorType::getElementCount
ElementCount getElementCount() const
Return an ElementCount instance to represent the (possibly scalable) number of elements in the vector...
Definition: DerivedTypes.h:626
llvm::IntegerType
Class to represent integer types.
Definition: DerivedTypes.h:40
llvm::ArrayType::operator=
ArrayType & operator=(const ArrayType &)=delete
llvm::FunctionType::param_begin
param_iterator param_begin() const
Definition: DerivedTypes.h:127
llvm::Type::getScalarSizeInBits
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Definition: Type.cpp:153
llvm::FunctionType::params
ArrayRef< Type * > params() const
Definition: DerivedTypes.h:129
llvm::FunctionCallee::getFunctionType
FunctionType * getFunctionType()
Definition: DerivedTypes.h:181
llvm::StructType::setBody
std::enable_if_t< are_base_of< Type, Tys... >::value, void > setBody(Type *elt1, Tys *... elts)
Definition: DerivedTypes.h:305
llvm::Type::PointerTyID
@ PointerTyID
Pointers.
Definition: Type.h:73
llvm::IntegerType::getSignBit
uint64_t getSignBit() const
Return a uint64_t with just the most significant bit set (the sign bit, if the value is treated as a ...
Definition: DerivedTypes.h:81
llvm::FixedVectorType::get
static FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition: Type.cpp:650
llvm::PointerType::isOpaque
bool isOpaque() const
Definition: DerivedTypes.h:677
llvm::AddressSpace
AddressSpace
Definition: NVPTXBaseInfo.h:21
llvm::ScalableVectorType::getHalfElementsVectorType
static ScalableVectorType * getHalfElementsVectorType(ScalableVectorType *VTy)
Definition: DerivedTypes.h:607
llvm::VectorType::operator=
VectorType & operator=(const VectorType &)=delete
llvm::Type::getIntegerBitWidth
unsigned getIntegerBitWidth() const
Definition: DerivedTypes.h:96
Type.h
llvm::Type::getStructNumElements
unsigned getStructNumElements() const
Definition: DerivedTypes.h:347
llvm::Type::getExtendedType
Type * getExtendedType() const
Given scalar/vector integer type, returns a type with elements twice as wide as in the original type.
Definition: DerivedTypes.h:710
llvm::VectorType::isValidElementType
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:641
llvm::VectorType
Base class of all SIMD vector types.
Definition: DerivedTypes.h:388
llvm::ScalableVectorType::getExtendedElementVectorType
static ScalableVectorType * getExtendedElementVectorType(ScalableVectorType *VTy)
Definition: DerivedTypes.h:589
llvm::FixedVectorType::getExtendedElementVectorType
static FixedVectorType * getExtendedElementVectorType(FixedVectorType *VTy)
Definition: DerivedTypes.h:540
llvm::FunctionCallee::FunctionCallee
FunctionCallee(T *Fn)
Definition: DerivedTypes.h:169
llvm::FunctionType::param_iterator
Type::subtype_iterator param_iterator
Definition: DerivedTypes.h:125
llvm::PointerType::classof
static bool classof(const Type *T)
Implement support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:705
llvm::PointerType::getUnqual
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
Definition: DerivedTypes.h:650
llvm::Type::getWithNewBitWidth
Type * getWithNewBitWidth(unsigned NewBitWidth) const
Given an integer or vector type, change the lane bitwidth to NewBitwidth, whilst keeping the old numb...
Definition: DerivedTypes.h:726
llvm::VectorType::get
static VectorType * get(Type *ElementType, unsigned NumElements, bool Scalable)
Definition: DerivedTypes.h:426
llvm::StructType::isOpaque
bool isOpaque() const
Return true if this is a type with an identity that has no body specified yet.
Definition: DerivedTypes.h:280
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::FunctionCallee::FunctionCallee
FunctionCallee()=default
llvm::FunctionType::getParamType
Type * getParamType(unsigned i) const
Parameter type accessors.
Definition: DerivedTypes.h:134
llvm::FunctionType::isValidArgumentType
static bool isValidArgumentType(Type *ArgTy)
Return true if the specified type is valid as an argument type.
Definition: Type.cpp:362
llvm::PointerType
Class to represent pointers.
Definition: DerivedTypes.h:631
llvm::ScalableVectorType::getSubdividedVectorType
static ScalableVectorType * getSubdividedVectorType(ScalableVectorType *VTy, int NumSubdivs)
Definition: DerivedTypes.h:600
ArrayRef.h
llvm::IntegerType::classof
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:91
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::ArrayType::classof
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:378
llvm::FixedVectorType::classof
static bool classof(const Type *T)
Definition: DerivedTypes.h:563
llvm::Type::getArrayNumElements
uint64_t getArrayNumElements() const
Definition: DerivedTypes.h:383
llvm::FunctionType::classof
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:141
llvm::ArrayType::get
static ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
Definition: Type.cpp:604
llvm::APInt
Class for arbitrary precision integers.
Definition: APInt.h:70
llvm::FixedVectorType::getInteger
static FixedVectorType * getInteger(FixedVectorType *VTy)
Definition: DerivedTypes.h:536
llvm::Type::setSubclassData
void setSubclassData(unsigned val)
Definition: Type.h:98
llvm::Type::Type
Type(LLVMContext &C, TypeID tid)
Definition: Type.h:92
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::ScalableVectorType::classof
static bool classof(const Type *T)
Definition: DerivedTypes.h:621
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:212
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::FixedVectorType::getSubdividedVectorType
static FixedVectorType * getSubdividedVectorType(FixedVectorType *VTy, int NumSubdivs)
Definition: DerivedTypes.h:549
llvm::Type::getStructElementType
Type * getStructElementType(unsigned N) const
Definition: DerivedTypes.h:351
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:136
llvm::StructType::element_begin
element_iterator element_begin() const
Definition: DerivedTypes.h:316
llvm::StructType::indexValid
bool indexValid(const Value *V) const
Definition: Type.cpp:575
Compiler.h
llvm::FunctionCallee::FunctionCallee
FunctionCallee(std::nullptr_t)
Definition: DerivedTypes.h:177
llvm::VectorType::VectorType
VectorType(Type *ElType, unsigned EQ, Type::TypeID TID)
Definition: Type.cpp:627
llvm::StructType::getTypeAtIndex
Type * getTypeAtIndex(const Value *V) const
Given an index value into the type, return the type of the element.
Definition: Type.cpp:569
llvm::VectorType::getHalfElementsVectorType
static VectorType * getHalfElementsVectorType(VectorType *VTy)
This static method returns a VectorType with half as many elements as the input type and the same ele...
Definition: DerivedTypes.h:492
llvm::IntegerType::MAX_INT_BITS
@ MAX_INT_BITS
Maximum number of bits that can be specified.
Definition: DerivedTypes.h:52
llvm::Type::getContext
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
Definition: Type.h:127
llvm::StructType::getNumElements
unsigned getNumElements() const
Random access to the elements.
Definition: DerivedTypes.h:326
llvm::FunctionCallee::getCallee
Value * getCallee()
Definition: DerivedTypes.h:183
llvm::Type::IntegerTyID
@ IntegerTyID
Arbitrary bit width integers.
Definition: Type.h:71
Callee
amdgpu Simplify well known AMD library false FunctionCallee Callee
Definition: AMDGPULibCalls.cpp:206
llvm::VectorType::getExtendedElementVectorType
static VectorType * getExtendedElementVectorType(VectorType *VTy)
This static method is like getInteger except that the element types are twice as wide as the elements...
Definition: DerivedTypes.h:448
llvm::SymbolTableEntry
Symbol info for RuntimeDyld.
Definition: RuntimeDyldImpl.h:217
llvm::StructType::hasName
bool hasName() const
Return true if this is a named struct that has a non-empty name.
Definition: DerivedTypes.h:289
llvm::Type::NumContainedTys
unsigned NumContainedTys
Keeps track of how many Type*'s there are in the ContainedTys list.
Definition: Type.h:105
llvm::IntegerType::MIN_INT_BITS
@ MIN_INT_BITS
Minimum number of bits that can be specified.
Definition: DerivedTypes.h:51
llvm::StructType::operator=
StructType & operator=(const StructType &)=delete
llvm::ScalableVectorType::getMinNumElements
uint64_t getMinNumElements() const
Get the minimum number of elements in this vector.
Definition: DerivedTypes.h:619
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::PointerType::hasSameElementTypeAs
bool hasSameElementTypeAs(PointerType *Other)
Return true if both pointer types have the same element type.
Definition: DerivedTypes.h:700
llvm::Type::getIntNTy
static IntegerType * getIntNTy(LLVMContext &C, unsigned N)
Definition: Type.cpp:207
llvm::Type::getHalfTy
static Type * getHalfTy(LLVMContext &C)
Definition: Type.cpp:188
llvm::StructType::elements
ArrayRef< Type * > elements() const
Definition: DerivedTypes.h:318
llvm::Type::FixedVectorTyID
@ FixedVectorTyID
Fixed width SIMD vector type.
Definition: Type.h:76
llvm::Type::isIntOrIntVectorTy
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
Definition: Type.h:207
Casting.h
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::ScalableVectorType::get
static ScalableVectorType * get(Type *ElementType, const ScalableVectorType *SVTy)
Definition: DerivedTypes.h:579
llvm::StructType::element_end
element_iterator element_end() const
Definition: DerivedTypes.h:317
llvm::Type::ContainedTys
Type *const * ContainedTys
A pointer to the array of Types contained by this Type.
Definition: Type.h:112
llvm::makeArrayRef
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Definition: ArrayRef.h:476
llvm::StructType::create
static std::enable_if_t< are_base_of< Type, Tys... >::value, StructType * > create(StringRef Name, Type *elt1, Tys *... elts)
Definition: DerivedTypes.h:245
llvm::Type::StructTyID
@ StructTyID
Structures.
Definition: Type.h:74
llvm::StructType::isValidElementType
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:554
llvm::PointerType::isLoadableOrStorableType
static bool isLoadableOrStorableType(Type *ElemTy)
Return true if we can load or store from a pointer to this type.
Definition: Type.cpp:748
llvm::StructType::containsScalableVectorType
bool containsScalableVectorType() const
Returns true if this struct contains a scalable vector.
Definition: Type.cpp:399
llvm::PointerType::getWithSamePointeeType
static PointerType * getWithSamePointeeType(PointerType *PT, unsigned AddressSpace)
This constructs a pointer type with the same pointee type as input PointerType (or opaque pointer is ...
Definition: DerivedTypes.h:665
N
#define N
llvm::VectorType::get
static VectorType * get(Type *ElementType, const VectorType *Other)
Definition: DerivedTypes.h:432
llvm::IntegerType::getBitWidth
unsigned getBitWidth() const
Get the number of bits in this IntegerType.
Definition: DerivedTypes.h:71
llvm::StructType::classof
static bool classof(const Type *T)
Methods for support type inquiry through isa, cast, and dyn_cast.
Definition: DerivedTypes.h:338
llvm::FunctionCallee
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
Definition: DerivedTypes.h:164
llvm::StructType::getElementType
Type * getElementType(unsigned N) const
Definition: DerivedTypes.h:327
llvm::Type::ScalableVectorTyID
@ ScalableVectorTyID
Scalable SIMD vector type.
Definition: Type.h:77
llvm::SmallPtrSetImpl
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
Definition: SmallPtrSet.h:343
llvm::ArrayType::isValidElementType
static bool isValidElementType(Type *ElemTy)
Return true if the specified type is valid as a element type.
Definition: Type.cpp:616
llvm::IntegerType::get
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
Definition: Type.cpp:275
llvm::ScalableVectorType::get
static ScalableVectorType * get(Type *ElementType, unsigned MinNumElts)
Definition: Type.cpp:671
llvm::Type::TypeID
TypeID
Definitions of all of the base types for the Type system.
Definition: Type.h:54
llvm::FixedVectorType::getHalfElementsVectorType
static FixedVectorType * getHalfElementsVectorType(FixedVectorType *VTy)
Definition: DerivedTypes.h:555
llvm::Type::getFunctionParamType
Type * getFunctionParamType(unsigned i) const
Definition: DerivedTypes.h:152
llvm::StructType::isLiteral
bool isLiteral() const
Return true if this type is uniqued by structural equivalence, false if it is a struct definition.
Definition: DerivedTypes.h:276
llvm::StructType::isLayoutIdentical
bool isLayoutIdentical(StructType *Other) const
Return true if this is layout identical to the specified struct.
Definition: Type.cpp:560
llvm::FunctionType::getReturnType
Type * getReturnType() const
Definition: DerivedTypes.h:123
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::StructType::getTypeAtIndex
Type * getTypeAtIndex(unsigned N) const
Definition: DerivedTypes.h:333
llvm::VectorType::get
static VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Definition: Type.cpp:634
llvm::FixedVectorType::getDoubleElementsVectorType
static FixedVectorType * getDoubleElementsVectorType(FixedVectorType *VTy)
Definition: DerivedTypes.h:559
llvm::Type::getFloatTy
static Type * getFloatTy(LLVMContext &C)
Definition: Type.cpp:190
llvm::ArrayType::getElementType
Type * getElementType() const
Definition: DerivedTypes.h:369
Other
Optional< std::vector< StOtherPiece > > Other
Definition: ELFYAML.cpp:1172
llvm::FunctionType
Class to represent function types.
Definition: DerivedTypes.h:102
llvm::Type::getPrimitiveSizeInBits
TypeSize getPrimitiveSizeInBits() const LLVM_READONLY
Return the basic size of this type if it is a primitive type.
Definition: Type.cpp:128