- I != E; ++I)
- ValueMap[I] = new GlobalVariable(I->getType()->getElementType(), false,
- GlobalValue::ExternalLinkage, 0,
- I->getName(), New);
+ I != E; ++I) {
+ GlobalVariable *GV = new GlobalVariable(*New,
+ I->getType()->getElementType(),
+ I->isConstant(), I->getLinkage(),
+ (Constant*) 0, I->getName(),
+ (GlobalVariable*) 0,
+ I->getThreadLocalMode(),
+ I->getType()->getAddressSpace());
+ GV->copyAttributesFrom(I);
+ VMap[I] = GV;
+ }