mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
Adjust loop per review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46569 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6b2cf285bd
commit
43b8f3b7d3
@ -106,8 +106,7 @@ static GlobalVariable *getGlobalVariable(Value *V) {
|
|||||||
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
||||||
} else if (CE->getOpcode() == Instruction::GetElementPtr) {
|
} else if (CE->getOpcode() == Instruction::GetElementPtr) {
|
||||||
for (unsigned int i=1; i<CE->getNumOperands(); i++) {
|
for (unsigned int i=1; i<CE->getNumOperands(); i++) {
|
||||||
Constant* CI = cast<Constant>(CE->getOperand(i));
|
if (!CE->getOperand(i)->isNullValue())
|
||||||
if (!CI || !CI->isNullValue())
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
return dyn_cast<GlobalVariable>(CE->getOperand(0));
|
||||||
@ -126,8 +125,7 @@ static bool isGlobalVariable(Value *V) {
|
|||||||
return isa<GlobalVariable>(CE->getOperand(0));
|
return isa<GlobalVariable>(CE->getOperand(0));
|
||||||
} else if (CE->getOpcode() == Instruction::GetElementPtr) {
|
} else if (CE->getOpcode() == Instruction::GetElementPtr) {
|
||||||
for (unsigned int i=1; i<CE->getNumOperands(); i++) {
|
for (unsigned int i=1; i<CE->getNumOperands(); i++) {
|
||||||
Constant* CI = cast<Constant>(CE->getOperand(i));
|
if (!CE->getOperand(i)->isNullValue())
|
||||||
if (!CI || !CI->isNullValue())
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isa<GlobalVariable>(CE->getOperand(0));
|
return isa<GlobalVariable>(CE->getOperand(0));
|
||||||
|
Loading…
Reference in New Issue
Block a user