mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user