aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-12-08 18:06:16 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-12-08 18:06:16 +0000
commit38ecbf18eb9c8ca7ae08dfed4dc6fb4e3e5deb1e (patch)
tree25f918d862f8baff414df9382c194b5b5e072de1 /include/llvm
parent8894255fc01cd8dcdccc700fdd69186d02131ffe (diff)
downloadexternal_llvm-38ecbf18eb9c8ca7ae08dfed4dc6fb4e3e5deb1e.zip
external_llvm-38ecbf18eb9c8ca7ae08dfed4dc6fb4e3e5deb1e.tar.gz
external_llvm-38ecbf18eb9c8ca7ae08dfed4dc6fb4e3e5deb1e.tar.bz2
Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Constants.h2
-rw-r--r--include/llvm/DerivedTypes.h7
-rw-r--r--include/llvm/Type.h5
3 files changed, 11 insertions, 3 deletions
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<Constant*> &V);
- static Constant *get(const std::vector<Constant*> &V);
+ static Constant *get(const std::vector<Constant*> &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<const Type*> &Types);
+ StructType(const std::vector<const Type*> &Types, bool isPacked);
public:
/// StructType::get - This static method is the primary way to create a
/// StructType.
///
- static StructType *get(const std::vector<const Type*> &Params);
+ static StructType *get(const std::vector<const Type*> &Params,
+ bool isPacked=false);
// Iterator access to the elements
typedef std::vector<PATypeHandle>::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.