diff options
author | Dale Johannesen <dalej@apple.com> | 2008-01-30 19:44:39 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-01-30 19:44:39 +0000 |
commit | c59be5582149d604456c15a757cebe46d481cbbd (patch) | |
tree | 594935a96eba2e37b8684a929dffc5f7da5a872c /lib/CodeGen/MachineModuleInfo.cpp | |
parent | 2d37392200dddf071bdc54cc3f0217284f550126 (diff) | |
download | external_llvm-c59be5582149d604456c15a757cebe46d481cbbd.zip external_llvm-c59be5582149d604456c15a757cebe46d481cbbd.tar.gz external_llvm-c59be5582149d604456c15a757cebe46d481cbbd.tar.bz2 |
Adjust loop per review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineModuleInfo.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index c182394..80bedd0 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/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)); |