[opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposin...
[oota-llvm.git] / lib / CodeGen / GlobalMerge.cpp
index aaa37896293f3a3d3a4e0fbf00315e0127a351db..79de17567f764624c79d33deac9fab307614bdf4 100644 (file)
@@ -459,8 +459,7 @@ bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable *> &Globals,
       if (Linkage != GlobalValue::InternalLinkage) {
         // Generate a new alias...
         auto *PTy = cast<PointerType>(GEP->getType());
-        GlobalAlias::create(PTy->getElementType(), PTy->getAddressSpace(),
-                            Linkage, Name, GEP, &M);
+        GlobalAlias::create(PTy, Linkage, Name, GEP, &M);
       }
 
       NumMerged++;