mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Teach getUnderlyingObject and skipPointerCasts about GlobalAliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1af0513be7
commit
aac1bfb99a
@ -340,6 +340,10 @@ Value *Value::stripPointerCasts() {
|
||||
V = GEP->getPointerOperand();
|
||||
} else if (Operator::getOpcode(V) == Instruction::BitCast) {
|
||||
V = cast<Operator>(V)->getOperand(0);
|
||||
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
|
||||
if (GA->mayBeOverridden())
|
||||
return V;
|
||||
V = GA->getAliasee();
|
||||
} else {
|
||||
return V;
|
||||
}
|
||||
@ -357,6 +361,10 @@ Value *Value::getUnderlyingObject() {
|
||||
V = GEP->getPointerOperand();
|
||||
} else if (Operator::getOpcode(V) == Instruction::BitCast) {
|
||||
V = cast<Operator>(V)->getOperand(0);
|
||||
} else if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
|
||||
if (GA->mayBeOverridden())
|
||||
return V;
|
||||
V = GA->getAliasee();
|
||||
} else {
|
||||
return V;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user