Initialize.
[oota-llvm.git] / lib / Transforms / IPO / IPConstantPropagation.cpp
index 00b829e248df98a0a92a741c32224bcd70110ce0..88cdbd0d71bf1b0db49143d1151778624d60033a 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -33,7 +33,7 @@ namespace {
   /// IPCP - The interprocedural constant propagation pass
   ///
   struct VISIBILITY_HIDDEN IPCP : public ModulePass {
-    static const char ID; // Pass identifcation, replacement for typeid
+    static char ID; // Pass identification, replacement for typeid
     IPCP() : ModulePass((intptr_t)&ID) {}
 
     bool runOnModule(Module &M);
@@ -41,7 +41,7 @@ namespace {
     bool PropagateConstantsIntoArguments(Function &F);
     bool PropagateConstantReturn(Function &F);
   };
-  const char IPCP::ID = 0;
+  char IPCP::ID = 0;
   RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
 }
 
@@ -144,7 +144,7 @@ bool IPCP::PropagateConstantReturn(Function &F) {
   // Check to see if this function returns a constant.
   Value *RetVal = 0;
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
-    if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator()))
+    if (ReturnInst *RI = dyn_cast<ReturnInst>(BB->getTerminator())) {
       if (isa<UndefValue>(RI->getOperand(0))) {
         // Ignore.
       } else if (Constant *C = dyn_cast<Constant>(RI->getOperand(0))) {
@@ -155,6 +155,7 @@ bool IPCP::PropagateConstantReturn(Function &F) {
       } else {
         return false;  // Does not return a constant.
       }
+    }
 
   if (RetVal == 0) RetVal = UndefValue::get(F.getReturnType());