forked from OSchip/llvm-project
Implement handling of constantexprs for disambiguation. This implements
BasicAA/featuretest.ll:constexpr_test llvm-svn: 6740
This commit is contained in:
parent
b9119b3ed4
commit
1bec75e730
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue