summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-01-30 19:44:39 +0000
committerDale Johannesen <dalej@apple.com>2008-01-30 19:44:39 +0000
commit19cf69ff9d60b5288073e83a7f83bf228c167d84 (patch)
treef92ce5d60d49718bf28719a2272edcd959dc1fbf /llvm/lib/CodeGen/MachineModuleInfo.cpp
parenta3ff8e6110cc1e1a2d92e05c13382568219b1f6f (diff)
downloadbcm5719-llvm-19cf69ff9d60b5288073e83a7f83bf228c167d84.tar.gz
bcm5719-llvm-19cf69ff9d60b5288073e83a7f83bf228c167d84.zip
Adjust loop per review feedback.
llvm-svn: 46569
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index c1823947b1d..80bedd0ad7f 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -106,8 +106,7 @@ static GlobalVariable *getGlobalVariable(Value *V) {
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 @@ static bool isGlobalVariable(Value *V) {
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));
OpenPOWER on IntegriCloud