From: Jim Laskey Date: Tue, 25 Jul 2006 23:22:00 +0000 (+0000) Subject: Moving this function to a permanent home to prevent a dependency cycle created X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a25dfd2963070303bc17c7f55bf429a9b0f1d667;p=oota-llvm.git Moving this function to a permanent home to prevent a dependency cycle created 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 --- diff --git a/include/llvm/Type.h b/include/llvm/Type.h index c79aed676d6..9f73b25dbf7 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -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(Ty); - return *const_cast(this) = NewTy; -} - - //===----------------------------------------------------------------------===// // Provide specializations of GraphTraits to be able to treat a type as a diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index a393556bc66..1fdec943c4f 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -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(Ty); + return *const_cast(this) = NewTy; +} + //===----------------------------------------------------------------------===// // Type Class Implementation //===----------------------------------------------------------------------===//