File indexing completed on 2026-05-10 08:43:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef LLVM_IR_DERIVEDTYPES_H
0018 #define LLVM_IR_DERIVEDTYPES_H
0019
0020 #include "llvm/ADT/ArrayRef.h"
0021 #include "llvm/ADT/STLExtras.h"
0022 #include "llvm/ADT/StringRef.h"
0023 #include "llvm/IR/Type.h"
0024 #include "llvm/Support/Casting.h"
0025 #include "llvm/Support/Compiler.h"
0026 #include "llvm/Support/TypeSize.h"
0027 #include <cassert>
0028 #include <cstdint>
0029
0030 namespace llvm {
0031
0032 class Value;
0033 class APInt;
0034 class LLVMContext;
0035 template <typename T> class Expected;
0036 class Error;
0037
0038
0039
0040
0041
0042 class IntegerType : public Type {
0043 friend class LLVMContextImpl;
0044
0045 protected:
0046 explicit IntegerType(LLVMContext &C, unsigned NumBits) : Type(C, IntegerTyID){
0047 setSubclassData(NumBits);
0048 }
0049
0050 public:
0051
0052 enum {
0053 MIN_INT_BITS = 1,
0054 MAX_INT_BITS = (1<<23)
0055
0056
0057
0058
0059 };
0060
0061
0062
0063
0064
0065
0066 static IntegerType *get(LLVMContext &C, unsigned NumBits);
0067
0068
0069 IntegerType *getExtendedType() const {
0070 return Type::getIntNTy(getContext(), 2 * getScalarSizeInBits());
0071 }
0072
0073
0074 unsigned getBitWidth() const { return getSubclassData(); }
0075
0076
0077
0078 uint64_t getBitMask() const {
0079 return ~uint64_t(0UL) >> (64-getBitWidth());
0080 }
0081
0082
0083
0084 uint64_t getSignBit() const {
0085 return 1ULL << (getBitWidth()-1);
0086 }
0087
0088
0089
0090
0091 APInt getMask() const;
0092
0093
0094 static bool classof(const Type *T) {
0095 return T->getTypeID() == IntegerTyID;
0096 }
0097 };
0098
0099 unsigned Type::getIntegerBitWidth() const {
0100 return cast<IntegerType>(this)->getBitWidth();
0101 }
0102
0103
0104
0105 class FunctionType : public Type {
0106 FunctionType(Type *Result, ArrayRef<Type*> Params, bool IsVarArgs);
0107
0108 public:
0109 FunctionType(const FunctionType &) = delete;
0110 FunctionType &operator=(const FunctionType &) = delete;
0111
0112
0113 static FunctionType *get(Type *Result,
0114 ArrayRef<Type*> Params, bool isVarArg);
0115
0116
0117 static FunctionType *get(Type *Result, bool isVarArg);
0118
0119
0120 static bool isValidReturnType(Type *RetTy);
0121
0122
0123 static bool isValidArgumentType(Type *ArgTy);
0124
0125 bool isVarArg() const { return getSubclassData()!=0; }
0126 Type *getReturnType() const { return ContainedTys[0]; }
0127
0128 using param_iterator = Type::subtype_iterator;
0129
0130 param_iterator param_begin() const { return ContainedTys + 1; }
0131 param_iterator param_end() const { return &ContainedTys[NumContainedTys]; }
0132 ArrayRef<Type *> params() const {
0133 return ArrayRef(param_begin(), param_end());
0134 }
0135
0136
0137 Type *getParamType(unsigned i) const {
0138 assert(i < getNumParams() && "getParamType() out of range!");
0139 return ContainedTys[i + 1];
0140 }
0141
0142
0143
0144 unsigned getNumParams() const { return NumContainedTys - 1; }
0145
0146
0147 static bool classof(const Type *T) {
0148 return T->getTypeID() == FunctionTyID;
0149 }
0150 };
0151 static_assert(alignof(FunctionType) >= alignof(Type *),
0152 "Alignment sufficient for objects appended to FunctionType");
0153
0154 bool Type::isFunctionVarArg() const {
0155 return cast<FunctionType>(this)->isVarArg();
0156 }
0157
0158 Type *Type::getFunctionParamType(unsigned i) const {
0159 return cast<FunctionType>(this)->getParamType(i);
0160 }
0161
0162 unsigned Type::getFunctionNumParams() const {
0163 return cast<FunctionType>(this)->getNumParams();
0164 }
0165
0166
0167
0168
0169
0170 class FunctionCallee {
0171 public:
0172
0173
0174 template <typename T, typename U = decltype(&T::getFunctionType)>
0175 FunctionCallee(T *Fn)
0176 : FnTy(Fn ? Fn->getFunctionType() : nullptr), Callee(Fn) {}
0177
0178 FunctionCallee(FunctionType *FnTy, Value *Callee)
0179 : FnTy(FnTy), Callee(Callee) {
0180 assert((FnTy == nullptr) == (Callee == nullptr));
0181 }
0182
0183 FunctionCallee(std::nullptr_t) {}
0184
0185 FunctionCallee() = default;
0186
0187 FunctionType *getFunctionType() { return FnTy; }
0188
0189 Value *getCallee() { return Callee; }
0190
0191 explicit operator bool() { return Callee; }
0192
0193 private:
0194 FunctionType *FnTy = nullptr;
0195 Value *Callee = nullptr;
0196 };
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216
0217
0218 class StructType : public Type {
0219 StructType(LLVMContext &C) : Type(C, StructTyID) {}
0220
0221 enum {
0222
0223 SCDB_HasBody = 1,
0224 SCDB_Packed = 2,
0225 SCDB_IsLiteral = 4,
0226 SCDB_IsSized = 8,
0227 SCDB_ContainsScalableVector = 16,
0228 SCDB_NotContainsScalableVector = 32,
0229 SCDB_ContainsNonGlobalTargetExtType = 64,
0230 SCDB_NotContainsNonGlobalTargetExtType = 128,
0231 SCDB_ContainsNonLocalTargetExtType = 64,
0232 SCDB_NotContainsNonLocalTargetExtType = 128,
0233 };
0234
0235
0236
0237
0238
0239 void *SymbolTableEntry = nullptr;
0240
0241 public:
0242 StructType(const StructType &) = delete;
0243 StructType &operator=(const StructType &) = delete;
0244
0245
0246 static StructType *create(LLVMContext &Context, StringRef Name);
0247 static StructType *create(LLVMContext &Context);
0248
0249 static StructType *create(ArrayRef<Type *> Elements, StringRef Name,
0250 bool isPacked = false);
0251 static StructType *create(ArrayRef<Type *> Elements);
0252 static StructType *create(LLVMContext &Context, ArrayRef<Type *> Elements,
0253 StringRef Name, bool isPacked = false);
0254 static StructType *create(LLVMContext &Context, ArrayRef<Type *> Elements);
0255 template <class... Tys>
0256 static std::enable_if_t<are_base_of<Type, Tys...>::value, StructType *>
0257 create(StringRef Name, Type *elt1, Tys *... elts) {
0258 assert(elt1 && "Cannot create a struct type with no elements with this");
0259 return create(ArrayRef<Type *>({elt1, elts...}), Name);
0260 }
0261
0262
0263 static StructType *get(LLVMContext &Context, ArrayRef<Type*> Elements,
0264 bool isPacked = false);
0265
0266
0267 static StructType *get(LLVMContext &Context, bool isPacked = false);
0268
0269
0270
0271
0272 template <class... Tys>
0273 static std::enable_if_t<are_base_of<Type, Tys...>::value, StructType *>
0274 get(Type *elt1, Tys *... elts) {
0275 assert(elt1 && "Cannot create a struct type with no elements with this");
0276 LLVMContext &Ctx = elt1->getContext();
0277 return StructType::get(Ctx, ArrayRef<Type *>({elt1, elts...}));
0278 }
0279
0280
0281
0282 static StructType *getTypeByName(LLVMContext &C, StringRef Name);
0283
0284 bool isPacked() const { return (getSubclassData() & SCDB_Packed) != 0; }
0285
0286
0287
0288 bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
0289
0290
0291
0292 bool isOpaque() const { return (getSubclassData() & SCDB_HasBody) == 0; }
0293
0294
0295 bool isSized(SmallPtrSetImpl<Type *> *Visited = nullptr) const;
0296
0297
0298 bool isScalableTy(SmallPtrSetImpl<const Type *> &Visited) const;
0299 using Type::isScalableTy;
0300
0301
0302
0303 bool
0304 containsNonGlobalTargetExtType(SmallPtrSetImpl<const Type *> &Visited) const;
0305 using Type::containsNonGlobalTargetExtType;
0306
0307
0308
0309 bool
0310 containsNonLocalTargetExtType(SmallPtrSetImpl<const Type *> &Visited) const;
0311 using Type::containsNonLocalTargetExtType;
0312
0313
0314
0315
0316
0317
0318
0319 bool containsHomogeneousScalableVectorTypes() const;
0320
0321
0322
0323 bool containsHomogeneousTypes() const;
0324
0325
0326 bool hasName() const { return SymbolTableEntry != nullptr; }
0327
0328
0329
0330
0331 StringRef getName() const;
0332
0333
0334
0335 void setName(StringRef Name);
0336
0337
0338
0339 void setBody(ArrayRef<Type*> Elements, bool isPacked = false);
0340
0341
0342
0343 Error setBodyOrError(ArrayRef<Type *> Elements, bool isPacked = false);
0344
0345
0346
0347 Error checkBody(ArrayRef<Type *> Elements);
0348
0349
0350 static bool isValidElementType(Type *ElemTy);
0351
0352
0353 using element_iterator = Type::subtype_iterator;
0354
0355 element_iterator element_begin() const { return ContainedTys; }
0356 element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
0357 ArrayRef<Type *> elements() const {
0358 return ArrayRef(element_begin(), element_end());
0359 }
0360
0361
0362 bool isLayoutIdentical(StructType *Other) const;
0363
0364
0365 unsigned getNumElements() const { return NumContainedTys; }
0366 Type *getElementType(unsigned N) const {
0367 assert(N < NumContainedTys && "Element number out of range!");
0368 return ContainedTys[N];
0369 }
0370
0371 Type *getTypeAtIndex(const Value *V) const;
0372 Type *getTypeAtIndex(unsigned N) const { return getElementType(N); }
0373 bool indexValid(const Value *V) const;
0374 bool indexValid(unsigned Idx) const { return Idx < getNumElements(); }
0375
0376
0377 static bool classof(const Type *T) {
0378 return T->getTypeID() == StructTyID;
0379 }
0380 };
0381
0382 StringRef Type::getStructName() const {
0383 return cast<StructType>(this)->getName();
0384 }
0385
0386 unsigned Type::getStructNumElements() const {
0387 return cast<StructType>(this)->getNumElements();
0388 }
0389
0390 Type *Type::getStructElementType(unsigned N) const {
0391 return cast<StructType>(this)->getElementType(N);
0392 }
0393
0394
0395 class ArrayType : public Type {
0396
0397 Type *ContainedType;
0398
0399 uint64_t NumElements;
0400
0401 ArrayType(Type *ElType, uint64_t NumEl);
0402
0403 public:
0404 ArrayType(const ArrayType &) = delete;
0405 ArrayType &operator=(const ArrayType &) = delete;
0406
0407 uint64_t getNumElements() const { return NumElements; }
0408 Type *getElementType() const { return ContainedType; }
0409
0410
0411 static ArrayType *get(Type *ElementType, uint64_t NumElements);
0412
0413
0414 static bool isValidElementType(Type *ElemTy);
0415
0416
0417 static bool classof(const Type *T) {
0418 return T->getTypeID() == ArrayTyID;
0419 }
0420 };
0421
0422 uint64_t Type::getArrayNumElements() const {
0423 return cast<ArrayType>(this)->getNumElements();
0424 }
0425
0426
0427 class VectorType : public Type {
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438
0439
0440
0441
0442 Type *ContainedType;
0443
0444 protected:
0445
0446
0447
0448
0449
0450
0451
0452 const unsigned ElementQuantity;
0453
0454 VectorType(Type *ElType, unsigned EQ, Type::TypeID TID);
0455
0456 public:
0457 VectorType(const VectorType &) = delete;
0458 VectorType &operator=(const VectorType &) = delete;
0459
0460 Type *getElementType() const { return ContainedType; }
0461
0462
0463 static VectorType *get(Type *ElementType, ElementCount EC);
0464
0465 static VectorType *get(Type *ElementType, unsigned NumElements,
0466 bool Scalable) {
0467 return VectorType::get(ElementType,
0468 ElementCount::get(NumElements, Scalable));
0469 }
0470
0471 static VectorType *get(Type *ElementType, const VectorType *Other) {
0472 return VectorType::get(ElementType, Other->getElementCount());
0473 }
0474
0475
0476
0477
0478 static VectorType *getInteger(VectorType *VTy) {
0479 unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
0480 assert(EltBits && "Element size must be of a non-zero size");
0481 Type *EltTy = IntegerType::get(VTy->getContext(), EltBits);
0482 return VectorType::get(EltTy, VTy->getElementCount());
0483 }
0484
0485
0486
0487 static VectorType *getExtendedElementVectorType(VectorType *VTy) {
0488 assert(VTy->isIntOrIntVectorTy() && "VTy expected to be a vector of ints.");
0489 auto *EltTy = cast<IntegerType>(VTy->getElementType());
0490 return VectorType::get(EltTy->getExtendedType(), VTy->getElementCount());
0491 }
0492
0493
0494
0495
0496 static VectorType *getTruncatedElementVectorType(VectorType *VTy) {
0497 Type *EltTy;
0498 if (VTy->getElementType()->isFloatingPointTy()) {
0499 switch(VTy->getElementType()->getTypeID()) {
0500 case DoubleTyID:
0501 EltTy = Type::getFloatTy(VTy->getContext());
0502 break;
0503 case FloatTyID:
0504 EltTy = Type::getHalfTy(VTy->getContext());
0505 break;
0506 default:
0507 llvm_unreachable("Cannot create narrower fp vector element type");
0508 }
0509 } else {
0510 unsigned EltBits = VTy->getElementType()->getPrimitiveSizeInBits();
0511 assert((EltBits & 1) == 0 &&
0512 "Cannot truncate vector element with odd bit-width");
0513 EltTy = IntegerType::get(VTy->getContext(), EltBits / 2);
0514 }
0515 return VectorType::get(EltTy, VTy->getElementCount());
0516 }
0517
0518
0519
0520
0521 static VectorType *getSubdividedVectorType(VectorType *VTy, int NumSubdivs) {
0522 for (int i = 0; i < NumSubdivs; ++i) {
0523 VTy = VectorType::getDoubleElementsVectorType(VTy);
0524 VTy = VectorType::getTruncatedElementVectorType(VTy);
0525 }
0526 return VTy;
0527 }
0528
0529
0530
0531 static VectorType *getHalfElementsVectorType(VectorType *VTy) {
0532 auto EltCnt = VTy->getElementCount();
0533 assert(EltCnt.isKnownEven() &&
0534 "Cannot halve vector with odd number of elements.");
0535 return VectorType::get(VTy->getElementType(),
0536 EltCnt.divideCoefficientBy(2));
0537 }
0538
0539
0540
0541 static VectorType *getDoubleElementsVectorType(VectorType *VTy) {
0542 auto EltCnt = VTy->getElementCount();
0543 assert((EltCnt.getKnownMinValue() * 2ull) <= UINT_MAX &&
0544 "Too many elements in vector");
0545 return VectorType::get(VTy->getElementType(), EltCnt * 2);
0546 }
0547
0548
0549 static bool isValidElementType(Type *ElemTy);
0550
0551
0552
0553 inline ElementCount getElementCount() const;
0554
0555
0556 static bool classof(const Type *T) {
0557 return T->getTypeID() == FixedVectorTyID ||
0558 T->getTypeID() == ScalableVectorTyID;
0559 }
0560 };
0561
0562
0563 class FixedVectorType : public VectorType {
0564 protected:
0565 FixedVectorType(Type *ElTy, unsigned NumElts)
0566 : VectorType(ElTy, NumElts, FixedVectorTyID) {}
0567
0568 public:
0569 static FixedVectorType *get(Type *ElementType, unsigned NumElts);
0570
0571 static FixedVectorType *get(Type *ElementType, const FixedVectorType *FVTy) {
0572 return get(ElementType, FVTy->getNumElements());
0573 }
0574
0575 static FixedVectorType *getInteger(FixedVectorType *VTy) {
0576 return cast<FixedVectorType>(VectorType::getInteger(VTy));
0577 }
0578
0579 static FixedVectorType *getExtendedElementVectorType(FixedVectorType *VTy) {
0580 return cast<FixedVectorType>(VectorType::getExtendedElementVectorType(VTy));
0581 }
0582
0583 static FixedVectorType *getTruncatedElementVectorType(FixedVectorType *VTy) {
0584 return cast<FixedVectorType>(
0585 VectorType::getTruncatedElementVectorType(VTy));
0586 }
0587
0588 static FixedVectorType *getSubdividedVectorType(FixedVectorType *VTy,
0589 int NumSubdivs) {
0590 return cast<FixedVectorType>(
0591 VectorType::getSubdividedVectorType(VTy, NumSubdivs));
0592 }
0593
0594 static FixedVectorType *getHalfElementsVectorType(FixedVectorType *VTy) {
0595 return cast<FixedVectorType>(VectorType::getHalfElementsVectorType(VTy));
0596 }
0597
0598 static FixedVectorType *getDoubleElementsVectorType(FixedVectorType *VTy) {
0599 return cast<FixedVectorType>(VectorType::getDoubleElementsVectorType(VTy));
0600 }
0601
0602 static bool classof(const Type *T) {
0603 return T->getTypeID() == FixedVectorTyID;
0604 }
0605
0606 unsigned getNumElements() const { return ElementQuantity; }
0607 };
0608
0609
0610 class ScalableVectorType : public VectorType {
0611 protected:
0612 ScalableVectorType(Type *ElTy, unsigned MinNumElts)
0613 : VectorType(ElTy, MinNumElts, ScalableVectorTyID) {}
0614
0615 public:
0616 static ScalableVectorType *get(Type *ElementType, unsigned MinNumElts);
0617
0618 static ScalableVectorType *get(Type *ElementType,
0619 const ScalableVectorType *SVTy) {
0620 return get(ElementType, SVTy->getMinNumElements());
0621 }
0622
0623 static ScalableVectorType *getInteger(ScalableVectorType *VTy) {
0624 return cast<ScalableVectorType>(VectorType::getInteger(VTy));
0625 }
0626
0627 static ScalableVectorType *
0628 getExtendedElementVectorType(ScalableVectorType *VTy) {
0629 return cast<ScalableVectorType>(
0630 VectorType::getExtendedElementVectorType(VTy));
0631 }
0632
0633 static ScalableVectorType *
0634 getTruncatedElementVectorType(ScalableVectorType *VTy) {
0635 return cast<ScalableVectorType>(
0636 VectorType::getTruncatedElementVectorType(VTy));
0637 }
0638
0639 static ScalableVectorType *getSubdividedVectorType(ScalableVectorType *VTy,
0640 int NumSubdivs) {
0641 return cast<ScalableVectorType>(
0642 VectorType::getSubdividedVectorType(VTy, NumSubdivs));
0643 }
0644
0645 static ScalableVectorType *
0646 getHalfElementsVectorType(ScalableVectorType *VTy) {
0647 return cast<ScalableVectorType>(VectorType::getHalfElementsVectorType(VTy));
0648 }
0649
0650 static ScalableVectorType *
0651 getDoubleElementsVectorType(ScalableVectorType *VTy) {
0652 return cast<ScalableVectorType>(
0653 VectorType::getDoubleElementsVectorType(VTy));
0654 }
0655
0656
0657
0658 unsigned getMinNumElements() const { return ElementQuantity; }
0659
0660 static bool classof(const Type *T) {
0661 return T->getTypeID() == ScalableVectorTyID;
0662 }
0663 };
0664
0665 inline ElementCount VectorType::getElementCount() const {
0666 return ElementCount::get(ElementQuantity, isa<ScalableVectorType>(this));
0667 }
0668
0669
0670 class PointerType : public Type {
0671 explicit PointerType(LLVMContext &C, unsigned AddrSpace);
0672
0673 public:
0674 PointerType(const PointerType &) = delete;
0675 PointerType &operator=(const PointerType &) = delete;
0676
0677
0678
0679 static PointerType *get(Type *ElementType, unsigned AddressSpace);
0680
0681
0682 static PointerType *get(LLVMContext &C, unsigned AddressSpace);
0683
0684
0685
0686 static PointerType *getUnqual(Type *ElementType) {
0687 return PointerType::get(ElementType, 0);
0688 }
0689
0690
0691
0692 static PointerType *getUnqual(LLVMContext &C) {
0693 return PointerType::get(C, 0);
0694 }
0695
0696
0697 static bool isValidElementType(Type *ElemTy);
0698
0699
0700 static bool isLoadableOrStorableType(Type *ElemTy);
0701
0702
0703 inline unsigned getAddressSpace() const { return getSubclassData(); }
0704
0705
0706 static bool classof(const Type *T) {
0707 return T->getTypeID() == PointerTyID;
0708 }
0709 };
0710
0711 Type *Type::getExtendedType() const {
0712 assert(
0713 isIntOrIntVectorTy() &&
0714 "Original type expected to be a vector of integers or a scalar integer.");
0715 if (auto *VTy = dyn_cast<VectorType>(this))
0716 return VectorType::getExtendedElementVectorType(
0717 const_cast<VectorType *>(VTy));
0718 return cast<IntegerType>(this)->getExtendedType();
0719 }
0720
0721 Type *Type::getWithNewType(Type *EltTy) const {
0722 if (auto *VTy = dyn_cast<VectorType>(this))
0723 return VectorType::get(EltTy, VTy->getElementCount());
0724 return EltTy;
0725 }
0726
0727 Type *Type::getWithNewBitWidth(unsigned NewBitWidth) const {
0728 assert(
0729 isIntOrIntVectorTy() &&
0730 "Original type expected to be a vector of integers or a scalar integer.");
0731 return getWithNewType(getIntNTy(getContext(), NewBitWidth));
0732 }
0733
0734 unsigned Type::getPointerAddressSpace() const {
0735 return cast<PointerType>(getScalarType())->getAddressSpace();
0736 }
0737
0738
0739
0740
0741
0742
0743
0744 class TargetExtType : public Type {
0745 TargetExtType(LLVMContext &C, StringRef Name, ArrayRef<Type *> Types,
0746 ArrayRef<unsigned> Ints);
0747
0748
0749 StringRef Name;
0750 unsigned *IntParams;
0751
0752 public:
0753 TargetExtType(const TargetExtType &) = delete;
0754 TargetExtType &operator=(const TargetExtType &) = delete;
0755
0756
0757
0758 static TargetExtType *get(LLVMContext &Context, StringRef Name,
0759 ArrayRef<Type *> Types = {},
0760 ArrayRef<unsigned> Ints = {});
0761
0762
0763
0764
0765 static Expected<TargetExtType *> getOrError(LLVMContext &Context,
0766 StringRef Name,
0767 ArrayRef<Type *> Types = {},
0768 ArrayRef<unsigned> Ints = {});
0769
0770
0771
0772
0773 static Expected<TargetExtType *> checkParams(TargetExtType *TTy);
0774
0775
0776
0777
0778 StringRef getName() const { return Name; }
0779
0780
0781
0782 ArrayRef<Type *> type_params() const {
0783 return ArrayRef(type_param_begin(), type_param_end());
0784 }
0785
0786 using type_param_iterator = Type::subtype_iterator;
0787 type_param_iterator type_param_begin() const { return ContainedTys; }
0788 type_param_iterator type_param_end() const {
0789 return &ContainedTys[NumContainedTys];
0790 }
0791
0792 Type *getTypeParameter(unsigned i) const { return getContainedType(i); }
0793 unsigned getNumTypeParameters() const { return getNumContainedTypes(); }
0794
0795
0796
0797 ArrayRef<unsigned> int_params() const {
0798 return ArrayRef(IntParams, getNumIntParameters());
0799 }
0800
0801 unsigned getIntParameter(unsigned i) const { return IntParams[i]; }
0802 unsigned getNumIntParameters() const { return getSubclassData(); }
0803
0804 enum Property {
0805
0806 HasZeroInit = 1U << 0,
0807
0808 CanBeGlobal = 1U << 1,
0809
0810
0811 CanBeLocal = 1U << 2,
0812 };
0813
0814
0815 bool hasProperty(Property Prop) const;
0816
0817
0818
0819
0820
0821 Type *getLayoutType() const;
0822
0823
0824 static bool classof(const Type *T) { return T->getTypeID() == TargetExtTyID; }
0825 };
0826
0827 StringRef Type::getTargetExtName() const {
0828 return cast<TargetExtType>(this)->getName();
0829 }
0830
0831 }
0832
0833 #endif