Fix a bug introduced by "internal linkage" work.
[oota-llvm.git] / lib / Transforms / Utils / Linker.cpp
index 8a0294660fdb5620d26d89fa83ee9b27f99a5cb8..f04c8a46a3140f74ebc1a00cc648d1ee971107e2 100644 (file)
@@ -179,7 +179,7 @@ static bool LinkGlobals(Module *Dest, const Module *Src,
       // later by LinkGlobalInits...
       //
       GlobalVariable *DGV = 
-        new GlobalVariable(SGV->getType()->getValueType(), SGV->isConstant(),
+        new GlobalVariable(SGV->getType()->getElementType(), SGV->isConstant(),
                            SGV->hasInternalLinkage(), 0, SGV->getName());
 
       // Add the new global to the dest module