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:
Dan Gohman 2009-08-27 17:55:13 +00:00
parent 1af0513be7
commit aac1bfb99a

View File

@ -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;
}