From 38ecbf18eb9c8ca7ae08dfed4dc6fb4e3e5deb1e Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Fri, 8 Dec 2006 18:06:16 +0000 Subject: Packed Structures git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Constants.h | 2 +- include/llvm/DerivedTypes.h | 7 +++++-- include/llvm/Type.h | 5 +++++ 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h index 8c31ba3..04cad0b 100644 --- a/include/llvm/Constants.h +++ b/include/llvm/Constants.h @@ -370,7 +370,7 @@ public: /// get() - Static factory methods - Return objects of the specified value /// static Constant *get(const StructType *T, const std::vector &V); - static Constant *get(const std::vector &V); + static Constant *get(const std::vector &V, bool packed = false); /// getType() specialization - Reduce amount of casting... /// diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index 13344ba..fafcea4 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -163,13 +163,14 @@ protected: /// /// Private ctor - Only can be created by a static member... /// - StructType(const std::vector &Types); + StructType(const std::vector &Types, bool isPacked); public: /// StructType::get - This static method is the primary way to create a /// StructType. /// - static StructType *get(const std::vector &Params); + static StructType *get(const std::vector &Params, + bool isPacked=false); // Iterator access to the elements typedef std::vector::const_iterator element_iterator; @@ -198,6 +199,8 @@ public: static inline bool classof(const Type *T) { return T->getTypeID() == StructTyID; } + + bool isPacked() const { return getSubclassData(); } }; diff --git a/include/llvm/Type.h b/include/llvm/Type.h index 4da8feb..79fe0df 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -85,6 +85,7 @@ public: ArrayTyID , PointerTyID, // Array... pointer... OpaqueTyID, // Opaque type instances... PackedTyID, // SIMD 'packed' format... + BC_ONLY_PackedStructTyID, // packed struct, for BC rep only //... NumTypeIDs, // Must remain as last defined ID @@ -95,6 +96,7 @@ public: private: TypeID ID : 8; // The current base type of this type. bool Abstract : 1; // True if type contains an OpaqueType + bool SubclassData : 1; //Space for subclasses to store a flag /// RefCount - This counts the number of PATypeHolders that are pointing to /// this type. When this number falls to zero, if the type is abstract and @@ -117,6 +119,9 @@ protected: unsigned getRefCount() const { return RefCount; } + bool getSubclassData() const { return SubclassData; } + void setSubclassData(bool b) { SubclassData = b; } + /// ForwardType - This field is used to implement the union find scheme for /// abstract types. When types are refined to other types, this field is set /// to the more refined type. Only abstract types can be forwarded. -- cgit v1.1