Move bypassSlowDivision into the llvm namespace.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 10 Sep 2012 11:52:08 +0000 (11:52 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 10 Sep 2012 11:52:08 +0000 (11:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163503 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/BypassSlowDivision.h
lib/Transforms/Utils/BypassSlowDivision.cpp

index 3646d736aba4685c894cc5a1aa2fab5876b64231..c262434b662871221b769361d1d774d34360ed64 100644 (file)
 
 #include "llvm/Function.h"
 
+namespace llvm {
+
 /// This optimization identifies DIV instructions that can be
 /// profitably bypassed and carried out with a shorter, faster divide.
-bool bypassSlowDivision(llvm::Function &F,
-                        llvm::Function::iterator &I,
-                        const llvm::DenseMap<llvm::Type *, llvm::Type *> &BypassTypeMap);
+bool bypassSlowDivision(Function &F,
+                        Function::iterator &I,
+                        const DenseMap<Type *, Type *> &BypassTypeMap);
+
+} // End llvm namespace
 
 #endif
index b694779a5323721943c333d1ed6ed61f3d39d390..30d60be277d6ef5997610c8bd0513ee9146e962c 100644 (file)
@@ -24,7 +24,7 @@
 
 using namespace llvm;
 
-namespace llvm {
+namespace {
   struct DivOpInfo {
     bool SignedOp;
     Value *Dividend;
@@ -41,7 +41,9 @@ namespace llvm {
     DivPhiNodes(PHINode *InQuotient, PHINode *InRemainder)
       : Quotient(InQuotient), Remainder(InRemainder) {}
   };
+}
 
+namespace llvm {
   template<>
   struct DenseMapInfo<DivOpInfo> {
     static bool isEqual(const DivOpInfo &Val1, const DivOpInfo &Val2) {
@@ -217,9 +219,9 @@ static bool reuseOrInsertFastDiv(Function &F,
 
 // bypassSlowDivision - This optimization identifies DIV instructions that can
 // be profitably bypassed and carried out with a shorter, faster divide.
-bool bypassSlowDivision(Function &F,
-                        Function::iterator &I,
-                        const llvm::DenseMap<Type *, Type *> &BypassTypeMap) {
+bool llvm::bypassSlowDivision(Function &F,
+                              Function::iterator &I,
+                              const DenseMap<Type *, Type *> &BypassTypeMap) {
   DivCacheTy DivCache;
 
   bool MadeChange = false;