1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[NFC] Use Aliasee to determine Type and AddrSpace in GlobalAlias::create()

As opposed to going through the Aliasee type.

For opaque pointers, we're trying to remove uses of PointerType::getElementType().

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D101715
This commit is contained in:
Arthur Eubanks 2021-05-01 21:44:32 -07:00
parent b7eb3dfd3b
commit 2b3350003c

View File

@ -502,8 +502,7 @@ GlobalAlias *GlobalAlias::create(Type *Ty, unsigned AddressSpace,
GlobalAlias *GlobalAlias::create(LinkageTypes Link, const Twine &Name,
GlobalValue *Aliasee) {
PointerType *PTy = Aliasee->getType();
return create(PTy->getElementType(), PTy->getAddressSpace(), Link, Name,
return create(Aliasee->getValueType(), Aliasee->getAddressSpace(), Link, Name,
Aliasee);
}