//
// 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.
//
//===----------------------------------------------------------------------===//
//
/// 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);
bool PropagateConstantsIntoArguments(Function &F);
bool PropagateConstantReturn(Function &F);
};
- const char IPCP::ID = 0;
+ char IPCP::ID = 0;
RegisterPass<IPCP> X("ipconstprop", "Interprocedural constant propagation");
}
// 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))) {
} else {
return false; // Does not return a constant.
}
+ }
if (RetVal == 0) RetVal = UndefValue::get(F.getReturnType());