From 16a2f3e3022a48426e10ab7b822e8dc824abe23c Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Mon, 14 Sep 2015 18:01:59 +0000 Subject: Revert "[opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space" This was a flawed change - it just caused the getElementType call to be deferred until later, when we really need to remove it. Now that the IR for GlobalAliases has been updated, the root cause is addressed that way instead and this change is no longer needed (and in fact gets in the way - because we want to pass the pointee type directly down further). Follow up patches to push this through GlobalValue, bitcode format, etc, will come along soon. This reverts commit 236160. llvm-svn: 247585 --- llvm/lib/CodeGen/GlobalMerge.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp index 73543cb3de3..3d3f354bcdd 100644 --- a/llvm/lib/CodeGen/GlobalMerge.cpp +++ b/llvm/lib/CodeGen/GlobalMerge.cpp @@ -462,7 +462,8 @@ bool GlobalMerge::doMerge(const SmallVectorImpl &Globals, if (Linkage != GlobalValue::InternalLinkage || !TM->getTargetTriple().isOSBinFormatMachO()) { auto *PTy = cast(GEP->getType()); - GlobalAlias::create(PTy, Linkage, Name, GEP, &M); + GlobalAlias::create(PTy->getElementType(), PTy->getAddressSpace(), + Linkage, Name, GEP, &M); } NumMerged++; -- cgit v1.2.3