Implement handling of constantexprs for disambiguation. This implements

BasicAA/featuretest.ll:constexpr_test


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6740 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-06-17 15:25:37 +00:00
parent 1ae9143050
commit 388f669d95

View File

@ -69,6 +69,12 @@ static const Value *getUnderlyingObject(const Value *V) {
if (const Instruction *I = dyn_cast<Instruction>(V)) {
if (isa<CastInst>(I) || isa<GetElementPtrInst>(I))
return getUnderlyingObject(I->getOperand(0));
} else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) {
if (CE->getOpcode() == Instruction::Cast ||
CE->getOpcode() == Instruction::GetElementPtr)
return getUnderlyingObject(CE->getOperand(0));
} else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V)) {
return CPR->getValue();
}
return 0;
}