Fix ODR violations caused by putting anonymous namespaces in header files (and
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Mar 2015 02:36:51 +0000 (02:36 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Mar 2015 02:36:51 +0000 (02:36 +0000)
then using the symbols from those anonymous namespaces from outside the
anonymous namespace).

This was "detected" by causing the modules selfhost to fail in some cases.
The corresponding Clang bug was fixed in r232455.

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

include/llvm/Analysis/DominanceFrontierImpl.h
include/llvm/Analysis/LoopInfoImpl.h

index 735bfb83671d52f8987aa31a7e63df36ea367772..278d29815166eb33f31890e7095975983cc41a8f 100644 (file)
@@ -23,7 +23,6 @@
 
 namespace llvm {
 
-namespace {
 template <class BlockT>
 class DFCalculateWorkObject {
 public:
@@ -37,7 +36,6 @@ public:
   const DomTreeNodeT *Node;
   const DomTreeNodeT *parentNode;
 };
-}
 
 template <class BlockT>
 void DominanceFrontierBase<BlockT>::removeBlock(BlockT *BB) {
index 3321f391f56ca32abecdfd71abaae9beb03e4545..7cc4a77c690435d3356b394f93b8324fad68d2e1 100644 (file)
@@ -402,7 +402,6 @@ static void discoverAndMapSubloop(LoopT *L, ArrayRef<BlockT*> Backedges,
   L->reserveBlocks(NumBlocks);
 }
 
-namespace {
 /// Populate all loop data in a stable order during a single forward DFS.
 template<class BlockT, class LoopT>
 class PopulateLoopsDFS {
@@ -430,7 +429,6 @@ protected:
     DFSStack.push_back(std::make_pair(Block, BlockTraits::child_begin(Block)));
   }
 };
-} // anonymous
 
 /// Top-level driver for the forward DFS within the loop.
 template<class BlockT, class LoopT>