[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 942e068d7a
commit 99173fd03a

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