X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FIR%2FDerivedTypes.h;h=071e69b1e808c0496ed4afa6e7fd7aef96ad9143;hb=74012f5a19492f002994872f6ed1cd96383b620e;hp=356148900072ef3a8fb6460fd0e5b0874bde09fd;hpb=c36e746e9802fa1d5c36e6f98c8bc5cb440be59a;p=oota-llvm.git diff --git a/include/llvm/IR/DerivedTypes.h b/include/llvm/IR/DerivedTypes.h index 35614890007..071e69b1e80 100644 --- a/include/llvm/IR/DerivedTypes.h +++ b/include/llvm/IR/DerivedTypes.h @@ -91,6 +91,10 @@ public: } }; +unsigned Type::getIntegerBitWidth() const { + return cast(this)->getBitWidth(); +} + /// FunctionType - Class to represent function types /// class FunctionType : public Type { @@ -143,6 +147,18 @@ public: static_assert(AlignOf::Alignment >= AlignOf::Alignment, "Alignment sufficient for objects appended to FunctionType"); +bool Type::isFunctionVarArg() const { + return cast(this)->isVarArg(); +} + +Type *Type::getFunctionParamType(unsigned i) const { + return cast(this)->getParamType(i); +} + +unsigned Type::getFunctionNumParams() const { + return cast(this)->getNumParams(); +} + /// CompositeType - Common super class of ArrayType, StructType, PointerType /// and VectorType. class CompositeType : public Type { @@ -279,8 +295,8 @@ public: /// isLayoutIdentical - Return true if this is layout identical to the /// specified struct. - bool isLayoutIdentical(StructType *Other) const; - + bool isLayoutIdentical(StructType *Other) const; + /// Random access to the elements unsigned getNumElements() const { return NumContainedTys; } Type *getElementType(unsigned N) const { @@ -294,6 +310,18 @@ public: } }; +StringRef Type::getStructName() const { + return cast(this)->getName(); +} + +unsigned Type::getStructNumElements() const { + return cast(this)->getNumElements(); +} + +Type *Type::getStructElementType(unsigned N) const { + return cast(this)->getElementType(N); +} + /// SequentialType - This is the superclass of the array, pointer and vector /// type classes. All of these represent "arrays" in memory. The array type /// represents a specifically sized array, pointer types are unsized/unknown @@ -325,6 +353,10 @@ public: } }; +Type *Type::getSequentialElementType() const { + return cast(this)->getElementType(); +} + /// ArrayType - Class to represent array types. /// class ArrayType : public SequentialType { @@ -352,6 +384,10 @@ public: } }; +uint64_t Type::getArrayNumElements() const { + return cast(this)->getNumElements(); +} + /// VectorType - Class to represent vector types. /// class VectorType : public SequentialType { @@ -439,6 +475,10 @@ public: } }; +unsigned Type::getVectorNumElements() const { + return cast(this)->getNumElements(); +} + /// PointerType - Class to represent pointers. /// class PointerType : public SequentialType { @@ -473,6 +513,10 @@ public: } }; +unsigned Type::getPointerAddressSpace() const { + return cast(getScalarType())->getAddressSpace(); +} + } // End llvm namespace #endif