]> granicus.if.org Git - clang/commitdiff
Be more careful with anonymous namespaces, since Clang diagnoses the ambiguity here
authorDouglas Gregor <dgregor@apple.com>
Tue, 17 Nov 2009 06:52:37 +0000 (06:52 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 17 Nov 2009 06:52:37 +0000 (06:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89054 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/DeltaTree.cpp

index a94444b50c778d81da7d8b98904c86e704dca4b8..101cf93f9db9d1425174d0ee48a203defddb7fa5 100644 (file)
@@ -19,12 +19,6 @@ using namespace clang;
 using llvm::cast;
 using llvm::dyn_cast;
 
-namespace {
-  struct SourceDelta;
-  class DeltaTreeNode;
-  class DeltaTreeInteriorNode;
-}
-
 /// The DeltaTree class is a multiway search tree (BTree) structure with some
 /// fancy features.  B-Trees are are generally more memory and cache efficient
 /// than binary trees, because they store multiple keys/values in each node.
@@ -55,21 +49,17 @@ namespace {
       return Delta;
     }
   };
-} // end anonymous namespace
-
-
-namespace {
-  struct InsertResult {
-    DeltaTreeNode *LHS, *RHS;
-    SourceDelta Split;
-  };
-} // end anonymous namespace
-
-
-namespace {
+  
   /// DeltaTreeNode - The common part of all nodes.
   ///
   class DeltaTreeNode {
+  public:
+    struct InsertResult {
+      DeltaTreeNode *LHS, *RHS;
+      SourceDelta Split;
+    };
+    
+  private:
     friend class DeltaTreeInteriorNode;
 
     /// WidthFactor - This controls the number of K/V slots held in the BTree:
@@ -473,7 +463,7 @@ void DeltaTree::AddDelta(unsigned FileIndex, int Delta) {
   assert(Delta && "Adding a noop?");
   DeltaTreeNode *MyRoot = getRoot(Root);
 
-  InsertResult InsertRes;
+  DeltaTreeNode::InsertResult InsertRes;
   if (MyRoot->DoInsertion(FileIndex, Delta, &InsertRes)) {
     Root = MyRoot = new DeltaTreeInteriorNode(InsertRes);
   }