Moving this function to a permanent home to prevent a dependency cycle created
authorJim Laskey <jlaskey@mac.com>
Tue, 25 Jul 2006 23:22:00 +0000 (23:22 +0000)
committerJim Laskey <jlaskey@mac.com>
Tue, 25 Jul 2006 23:22:00 +0000 (23:22 +0000)
by the inline heuristic.  Was preventing llvm-gcc4 from building.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29278 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Type.h
lib/VMCore/Type.cpp

index c79aed676d69f0607ef10417c8625b899249e07e..9f73b25dbf7b7dc19f9ab1530b21451b9632f917 100644 (file)
@@ -401,18 +401,6 @@ inline void PATypeHolder::dropRef() {
     Ty->dropRef();
 }
 
-/// get - This implements the forwarding part of the union-find algorithm for
-/// abstract types.  Before every access to the Type*, we check to see if the
-/// type we are pointing to is forwarding to a new type.  If so, we drop our
-/// reference to the type.
-///
-inline Type* PATypeHolder::get() const {
-  const Type *NewTy = Ty->getForwardedType();
-  if (!NewTy) return const_cast<Type*>(Ty);
-  return *const_cast<PATypeHolder*>(this) = NewTy;
-}
-
-
 
 //===----------------------------------------------------------------------===//
 // Provide specializations of GraphTraits to be able to treat a type as a
index a393556bc668ea480e2fb10a4467ceb00e8a36f4..1fdec943c4fdf70bd761c1c1a6409bd2018f3e09 100644 (file)
@@ -33,6 +33,25 @@ using namespace llvm;
 
 AbstractTypeUser::~AbstractTypeUser() {}
 
+
+//===----------------------------------------------------------------------===//
+//                         Type PATypeHolder Implementation
+//===----------------------------------------------------------------------===//
+
+// This routine was moved here to resolve a cyclic dependency caused by
+// inline heuristics.
+
+/// get - This implements the forwarding part of the union-find algorithm for
+/// abstract types.  Before every access to the Type*, we check to see if the
+/// type we are pointing to is forwarding to a new type.  If so, we drop our
+/// reference to the type.
+///
+Type* PATypeHolder::get() const {
+  const Type *NewTy = Ty->getForwardedType();
+  if (!NewTy) return const_cast<Type*>(Ty);
+  return *const_cast<PATypeHolder*>(this) = NewTy;
+}
+
 //===----------------------------------------------------------------------===//
 //                         Type Class Implementation
 //===----------------------------------------------------------------------===//