mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-29 22:50:47 +00:00
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:
parent
1ae9143050
commit
388f669d95
@ -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
Block a user