[llvm] 7bb9f50 - fix warning: specialization of template in different namespace

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 03:29:19 PDT 2020


Author: Sameer Sahasrabuddhe
Date: 2020-04-15T15:57:53+05:30
New Revision: 7bb9f500e24a7564d813363afab0185969ade64e

URL: https://github.com/llvm/llvm-project/commit/7bb9f500e24a7564d813363afab0185969ade64e
DIFF: https://github.com/llvm/llvm-project/commit/7bb9f500e24a7564d813363afab0185969ade64e.diff

LOG: fix warning: specialization of template in different namespace

This is related to commit 8c11bc0cd06ffc18786a1a51ee5ce5b1cc4923f6
which introduces the FixIrreducible pass. The warning seems hard to
reproduce locally. The latest attempt ought to work.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/FixIrreducible.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/FixIrreducible.cpp b/llvm/lib/Transforms/Utils/FixIrreducible.cpp
index af5a99a0df79..ef8b80cecac9 100644
--- a/llvm/lib/Transforms/Utils/FixIrreducible.cpp
+++ b/llvm/lib/Transforms/Utils/FixIrreducible.cpp
@@ -236,8 +236,10 @@ static void createNaturalLoopInternal(LoopInfo &LI, DominatorTree &DT,
 #endif // EXPENSIVE_CHECKS
 }
 
+namespace llvm {
 // Enable the graph traits required for traversing a Loop body.
-template <> struct llvm::GraphTraits<Loop> : LoopBodyTraits {};
+template <> struct GraphTraits<Loop> : LoopBodyTraits {};
+} // namespace llvm
 
 // Overloaded wrappers to go with the function template below.
 BasicBlock *unwrapBlock(BasicBlock *B) { return B; }


        


More information about the llvm-commits mailing list