Get friendly
authorChris Lattner <sabre@nondot.org>
Fri, 5 Sep 2003 02:30:18 +0000 (02:30 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 5 Sep 2003 02:30:18 +0000 (02:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8356 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DerivedTypes.h

index f827753a6c9af096caa7f190aa8f283cbbee9e32..39a87b80d3690c2ffc6cb04e158de8da1f8a1e46 100644 (file)
 
 #include "llvm/Type.h"
 
+template<class ValType, class TypeClass> class TypeMap;
+class FunctionValType;
+class ArrayValType;
+class StructValType;
+class PointerValType;
+
 class DerivedType : public Type {
   char isRefining;                                   // Used for recursive types
 
@@ -89,6 +95,7 @@ public:
 
 struct FunctionType : public DerivedType {
   typedef std::vector<PATypeHandle> ParamTypes;
+  friend class TypeMap<FunctionValType, FunctionType>;
 private:
   PATypeHandle ResultType;
   ParamTypes ParamTys;
@@ -186,8 +193,8 @@ public:
 };
 
 
-class StructType : public CompositeType {
-public:
+struct StructType : public CompositeType {
+  friend class TypeMap<StructValType, StructType>;
   typedef std::vector<PATypeHandle> ElementTypes;
 
 private:
@@ -300,6 +307,7 @@ public:
 
 
 class ArrayType : public SequentialType {
+  friend class TypeMap<ArrayValType, ArrayType>;
   unsigned NumElements;
 
   ArrayType(const ArrayType &);                   // Do not implement
@@ -342,6 +350,7 @@ public:
 
 
 class PointerType : public SequentialType {
+  friend class TypeMap<PointerValType, PointerType>;
   PointerType(const PointerType &);                   // Do not implement
   const PointerType &operator=(const PointerType &);  // Do not implement
 protected: