Revert "[opaque pointer type] Pass GlobalAlias the actual pointer type rather than...
[oota-llvm.git] / lib / Transforms / Utils / CloneModule.cpp
index 5e7cae5364a4a222788f60ebd12c5640973df466..9136b19ccb9a0033841bbcf084c3df94e508c255 100644 (file)
@@ -95,7 +95,9 @@ Module *llvm::CloneModule(
       continue;
     }
     auto *PTy = cast<PointerType>(I->getType());
-    auto *GA = GlobalAlias::create(PTy, I->getLinkage(), I->getName(), New);
+    auto *GA =
+        GlobalAlias::create(PTy->getElementType(), PTy->getAddressSpace(),
+                            I->getLinkage(), I->getName(), New);
     GA->copyAttributesFrom(I);
     VMap[I] = GA;
   }