mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
handle gep aliasee
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8f57667a5d
commit
2bf6e6a632
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user