diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-07-25 23:22:00 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-07-25 23:22:00 +0000 |
commit | 4700b1534eef59fd773c0c5b9e8f12153072c48c (patch) | |
tree | a581e754b115d2fcf52554422a2ccdf048bb55c7 | |
parent | 658b9476f0c06ae025ce6a8fa83850fd52cb2a31 (diff) | |
download | llvm-4700b1534eef59fd773c0c5b9e8f12153072c48c.tar.gz |
Moving this function to a permanent home to prevent a dependency cycle created
by the inline heuristic. Was preventing llvm-gcc4 from building.
llvm-svn: 29278
-rw-r--r-- | llvm/include/llvm/Type.h | 12 | ||||
-rw-r--r-- | llvm/lib/VMCore/Type.cpp | 19 |
2 files changed, 19 insertions, 12 deletions
diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h index c79aed676d69..9f73b25dbf7b 100644 --- a/llvm/include/llvm/Type.h +++ b/llvm/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<Type*>(Ty); - return *const_cast<PATypeHolder*>(this) = NewTy; -} - - //===----------------------------------------------------------------------===// // Provide specializations of GraphTraits to be able to treat a type as a diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index a393556bc668..1fdec943c4fd 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/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<Type*>(Ty); + return *const_cast<PATypeHolder*>(this) = NewTy; +} + //===----------------------------------------------------------------------===// // Type Class Implementation //===----------------------------------------------------------------------===// |