summaryrefslogtreecommitdiff
path: root/include/llvm/Constants.h
diff options
context:
space:
mode:
authorTalin <viridia@gmail.com>2012-02-05 20:54:10 +0000
committerTalin <viridia@gmail.com>2012-02-05 20:54:10 +0000
commit2cb395eae71dacda49ca3fe758618fc3e0701659 (patch)
treec8abaa03940a385892716e78e1b80dcac0629880 /include/llvm/Constants.h
parentfad4d40f3792b0d9e101c40738e1f691131007d2 (diff)
downloadllvm-2cb395eae71dacda49ca3fe758618fc3e0701659.tar.gz
llvm-2cb395eae71dacda49ca3fe758618fc3e0701659.tar.bz2
llvm-2cb395eae71dacda49ca3fe758618fc3e0701659.tar.xz
Efficient Constant Uniquing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Constants.h')
-rw-r--r--include/llvm/Constants.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/llvm/Constants.h b/include/llvm/Constants.h
index a4723d37f0..0abe17d365 100644
--- a/include/llvm/Constants.h
+++ b/include/llvm/Constants.h
@@ -39,6 +39,8 @@ class SequentialType;
template<class ConstantClass, class TypeClass, class ValType>
struct ConstantCreator;
template<class ConstantClass, class TypeClass>
+struct ConstantArrayCreator;
+template<class ConstantClass, class TypeClass>
struct ConvertConstantType;
//===----------------------------------------------------------------------===//
@@ -343,8 +345,7 @@ public:
/// ConstantArray - Constant Array Declarations
///
class ConstantArray : public Constant {
- friend struct ConstantCreator<ConstantArray, ArrayType,
- std::vector<Constant*> >;
+ friend struct ConstantArrayCreator<ConstantArray, ArrayType>;
ConstantArray(const ConstantArray &); // DO NOT IMPLEMENT
protected:
ConstantArray(ArrayType *T, ArrayRef<Constant *> Val);
@@ -383,8 +384,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantArray, Constant)
// ConstantStruct - Constant Struct Declarations
//
class ConstantStruct : public Constant {
- friend struct ConstantCreator<ConstantStruct, StructType,
- std::vector<Constant*> >;
+ friend struct ConstantArrayCreator<ConstantStruct, StructType>;
ConstantStruct(const ConstantStruct &); // DO NOT IMPLEMENT
protected:
ConstantStruct(StructType *T, ArrayRef<Constant *> Val);
@@ -444,8 +444,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantStruct, Constant)
/// ConstantVector - Constant Vector Declarations
///
class ConstantVector : public Constant {
- friend struct ConstantCreator<ConstantVector, VectorType,
- std::vector<Constant*> >;
+ friend struct ConstantArrayCreator<ConstantVector, VectorType>;
ConstantVector(const ConstantVector &); // DO NOT IMPLEMENT
protected:
ConstantVector(VectorType *T, ArrayRef<Constant *> Val);