From 43b8f3b7d375187f843181ad3331ea9f06b473f5 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Wed, 30 Jan 2008 19:44:39 +0000 Subject: Adjust loop per review feedback. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46569 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineModuleInfo.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/CodeGen/MachineModuleInfo.cpp') diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index c1823947b1..80bedd0ad7 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -106,8 +106,7 @@ static GlobalVariable *getGlobalVariable(Value *V) { return dyn_cast(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; igetNumOperands(); i++) { - Constant* CI = cast(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return NULL; } return dyn_cast(CE->getOperand(0)); @@ -126,8 +125,7 @@ static bool isGlobalVariable(Value *V) { return isa(CE->getOperand(0)); } else if (CE->getOpcode() == Instruction::GetElementPtr) { for (unsigned int i=1; igetNumOperands(); i++) { - Constant* CI = cast(CE->getOperand(i)); - if (!CI || !CI->isNullValue()) + if (!CE->getOperand(i)->isNullValue()) return false; } return isa(CE->getOperand(0)); -- cgit v1.2.3-18-g5258