[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
Sun May 2 11:50:31 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG99173fd03a07: [NFC] Use Aliasee to determine Type and AddrSpace in GlobalAlias::create() (authored by aeubanks).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101715/new/

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.342255.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210502/af870012/attachment.bin>


More information about the llvm-commits mailing list