1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

handle gep aliasee

llvm-svn: 36815
This commit is contained in:
Chris Lattner 2007-05-05 23:49:02 +00:00
parent 236cf4a51b
commit 8070a25149

View File

@ -210,7 +210,7 @@ void GlobalAlias::setAliasee(Constant *Aliasee)
setOperand(0, Aliasee);
}
const GlobalValue *GlobalAlias::getAliasedGlobal() const {
const GlobalValue *GlobalAlias::getAliasedGlobal() const {
const Constant *C = getAliasee();
if (C) {
if (const GlobalValue *GV = dyn_cast<GlobalValue>(C))
@ -218,8 +218,9 @@ const GlobalValue *GlobalAlias::getAliasedGlobal() const {
else {
const ConstantExpr *CE = 0;
if ((CE = dyn_cast<ConstantExpr>(C)) &&
(CE->getOpcode() == Instruction::BitCast))
return cast<GlobalValue>(CE->getOperand(0));
(CE->getOpcode() == Instruction::BitCast ||
CE->getOpcode() == Instruction::GetElementPtr))
return dyn_cast<GlobalValue>(CE->getOperand(0));
else
assert(0 && "Unsupported aliasee");
}