Clean up the use of static and anonymous namespaces. This turned up
[oota-llvm.git] / lib / Transforms / Scalar / LoopStrengthReduce.cpp
index c6f02e8978c8e72ed4659540217e20d989ec1537..6d66d14ec9a81ac43fe81610b794948546bd4574 100644 (file)
@@ -194,10 +194,12 @@ private:
                                       Loop *L, bool isOnlyStride);
     void DeleteTriviallyDeadInstructions(SmallPtrSet<Instruction*,16> &Insts);
   };
-  char LoopStrengthReduce::ID = 0;
-  RegisterPass<LoopStrengthReduce> X("loop-reduce", "Loop Strength Reduction");
 }
 
+char LoopStrengthReduce::ID = 0;
+static RegisterPass<LoopStrengthReduce>
+X("loop-reduce", "Loop Strength Reduction");
+
 LoopPass *llvm::createLoopStrengthReducePass(const TargetLowering *TLI) {
   return new LoopStrengthReduce(TLI);
 }
@@ -430,7 +432,7 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV,
 bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
                                       SmallPtrSet<Instruction*,16> &Processed) {
   if (!I->getType()->isInteger() && !isa<PointerType>(I->getType()))
-      return false;   // Void and FP expressions cannot be reduced.
+    return false;   // Void and FP expressions cannot be reduced.
   if (!Processed.insert(I))
     return true;    // Instruction already handled.
   
@@ -1072,7 +1074,7 @@ static bool PartitionByIsUseOfPostIncrementedValue(const BasedUser &Val) {
   return Val.isUseOfPostIncrementedValue;
 }
 
-/// isNonConstantNegative - REturn true if the specified scev is negated, but
+/// isNonConstantNegative - Return true if the specified scev is negated, but
 /// not a constant.
 static bool isNonConstantNegative(const SCEVHandle &Expr) {
   SCEVMulExpr *Mul = dyn_cast<SCEVMulExpr>(Expr);
@@ -1271,7 +1273,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
 
   if (RewriteFactor == 0) {
     // Create a new Phi for this base, and stick it in the loop header.
-    NewPHI = new PHINode(ReplacedTy, "iv.", PhiInsertBefore);
+    NewPHI = PHINode::Create(ReplacedTy, "iv.", PhiInsertBefore);
     ++NumInserted;
   
     // Add common base to the new Phi node.
@@ -1367,7 +1369,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
         // We want this constant emitted into the preheader! This is just
         // using cast as a copy so BitCast (no-op cast) is appropriate
         BaseV = new BitCastInst(BaseV, BaseV->getType(), "preheaderinsert",
-                             PreInsertPt);       
+                                PreInsertPt);       
       }
     }