Author: johannes Date: Wed Jan 30 13:44:39 2008 New Revision: 46569 URL: http://llvm.org/viewvc/llvm-project?rev=46569&view=rev Log: Adjust loop per review feedback.
Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=46569&r1=46568&r2=46569&view=diff ============================================================================== --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original) +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Jan 30 13:44:39 2008 @@ -106,8 +106,7 @@ return dyn_cast<GlobalVariable>(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; i<CE->getNumOperands(); i++) { - Constant* CI = cast<Constant>(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return NULL; } return dyn_cast<GlobalVariable>(CE->getOperand(0)); @@ -126,8 +125,7 @@ return isa<GlobalVariable>(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; i<CE->getNumOperands(); i++) { - Constant* CI = cast<Constant>(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return false; } return isa<GlobalVariable>(CE->getOperand(0)); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits