From: Richard Smith Date: Tue, 17 Mar 2015 02:36:51 +0000 (+0000) Subject: Fix ODR violations caused by putting anonymous namespaces in header files (and X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3d8b0caf980edb684d6a12627a8e9aad685d8405;p=oota-llvm.git Fix ODR violations caused by putting anonymous namespaces in header files (and 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 --- diff --git a/include/llvm/Analysis/DominanceFrontierImpl.h b/include/llvm/Analysis/DominanceFrontierImpl.h index 735bfb83671..278d2981516 100644 --- a/include/llvm/Analysis/DominanceFrontierImpl.h +++ b/include/llvm/Analysis/DominanceFrontierImpl.h @@ -23,7 +23,6 @@ namespace llvm { -namespace { template class DFCalculateWorkObject { public: @@ -37,7 +36,6 @@ public: const DomTreeNodeT *Node; const DomTreeNodeT *parentNode; }; -} template void DominanceFrontierBase::removeBlock(BlockT *BB) { diff --git a/include/llvm/Analysis/LoopInfoImpl.h b/include/llvm/Analysis/LoopInfoImpl.h index 3321f391f56..7cc4a77c690 100644 --- a/include/llvm/Analysis/LoopInfoImpl.h +++ b/include/llvm/Analysis/LoopInfoImpl.h @@ -402,7 +402,6 @@ static void discoverAndMapSubloop(LoopT *L, ArrayRef Backedges, L->reserveBlocks(NumBlocks); } -namespace { /// Populate all loop data in a stable order during a single forward DFS. template 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