Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
authorJohn McCall <rjmccall@apple.com>
Sat, 19 Dec 2009 00:51:42 +0000 (00:51 +0000)
committerJohn McCall <rjmccall@apple.com>
Sat, 19 Dec 2009 00:51:42 +0000 (00:51 +0000)
the templates in TypesContext.h can find them.  Caught by clang++.

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

lib/VMCore/Type.cpp

index 310d0e3a29ac6ee757a7ec921e6e4461230da8d3..fd46aa1f41d1f183732e5c0540d8ee3cc076fcc0 100644 (file)
@@ -687,9 +687,11 @@ static bool TypesEqual(const Type *Ty, const Type *Ty2,
   }
 }
 
+namespace llvm { // in namespace llvm so findable by ADL
 static bool TypesEqual(const Type *Ty, const Type *Ty2) {
   std::map<const Type *, const Type *> EqTypes;
-  return TypesEqual(Ty, Ty2, EqTypes);
+  return ::TypesEqual(Ty, Ty2, EqTypes);
+}
 }
 
 // AbstractTypeHasCycleThrough - Return true there is a path from CurTy to
@@ -725,8 +727,10 @@ static bool ConcreteTypeHasCycleThrough(const Type *TargetTy, const Type *CurTy,
   return false;
 }
 
-/// TypeHasCycleThroughItself - Return true if the specified type has a cycle
-/// back to itself.
+/// TypeHasCycleThroughItself - Return true if the specified type has
+/// a cycle back to itself.
+
+namespace llvm { // in namespace llvm so it's findable by ADL
 static bool TypeHasCycleThroughItself(const Type *Ty) {
   SmallPtrSet<const Type*, 128> VisitedTypes;
 
@@ -743,6 +747,7 @@ static bool TypeHasCycleThroughItself(const Type *Ty) {
   }
   return false;
 }
+}
 
 //===----------------------------------------------------------------------===//
 // Function Type Factory and Value Class...