[opaque pointer types] Switch a few cases of getElementType over, since I had them...
[oota-llvm.git] / lib / Transforms / IPO / MergeFunctions.cpp
index a1f45137bf5c3207518900c57472fe420c6c06d6..2b0bcdff72f527ce1d8456336ca2191487570d18 100644 (file)
@@ -1682,9 +1682,7 @@ void MergeFunctions::writeThunk(Function *F, Function *G) {
 
 // Replace G with an alias to F and delete G.
 void MergeFunctions::writeAlias(Function *F, Function *G) {
-  PointerType *PTy = G->getType();
-  auto *GA = GlobalAlias::create(PTy->getElementType(), PTy->getAddressSpace(),
-                                 G->getLinkage(), "", F);
+  auto *GA = GlobalAlias::create(G->getLinkage(), "", F);
   F->setAlignment(std::max(F->getAlignment(), G->getAlignment()));
   GA->takeName(G);
   GA->setVisibility(G->getVisibility());