[PATCH] D101715: [NFC] Use Aliasee to determine Type and AddrSpace in GlobalAlias::create()
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 1 21:47:03 PDT 2021
aeubanks created this revision.
aeubanks added a reviewer: dblaikie.
Herald added subscribers: dexonsmith, hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
As opposed to going through the Aliasee type.
For opaque pointers, we're trying to remove uses of PointerType::getElementType().
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D101715
Files:
llvm/lib/IR/Globals.cpp
Index: llvm/lib/IR/Globals.cpp
===================================================================
--- llvm/lib/IR/Globals.cpp
+++ llvm/lib/IR/Globals.cpp
@@ -502,8 +502,7 @@
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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101715.342216.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210502/98903f95/attachment.bin>
More information about the llvm-commits
mailing list