SGVar->isConstant(), GlobalValue::ExternalLinkage,
/*init*/ nullptr, SGVar->getName(),
/*insertbefore*/ nullptr, SGVar->getThreadLocalMode(),
- SGVar->getType()->getAddressSpace());
+ SGVar->getAddressSpace());
NewDGV->setAlignment(MaybeAlign(SGVar->getAlignment()));
NewDGV->copyAttributesFrom(SGVar);
return NewDGV;
auto *Ty = TypeMap.get(SGIS->getValueType());
GlobalIndirectSymbol *GIS;
if (isa<GlobalAlias>(SGIS))
- GIS = GlobalAlias::create(Ty, SGIS->getType()->getPointerAddressSpace(),
+ GIS = GlobalAlias::create(Ty, SGIS->getAddressSpace(),
GlobalValue::ExternalLinkage, SGIS->getName(),
&DstM);
else
- GIS = GlobalIFunc::create(Ty, SGIS->getType()->getPointerAddressSpace(),
+ GIS = GlobalIFunc::create(Ty, SGIS->getAddressSpace(),
GlobalValue::ExternalLinkage, SGIS->getName(),
nullptr, &DstM);
GIS->copyAttributesFrom(SGIS);
Function::Create(cast<FunctionType>(TypeMap.get(SGV->getValueType())),
GlobalValue::ExternalLinkage, SGV->getName(), &DstM);
else
- NewGV = new GlobalVariable(
- DstM, TypeMap.get(SGV->getValueType()),
- /*isConstant*/ false, GlobalValue::ExternalLinkage,
- /*init*/ nullptr, SGV->getName(),
- /*insertbefore*/ nullptr, SGV->getThreadLocalMode(),
- SGV->getType()->getAddressSpace());
+ NewGV =
+ new GlobalVariable(DstM, TypeMap.get(SGV->getValueType()),
+ /*isConstant*/ false, GlobalValue::ExternalLinkage,
+ /*init*/ nullptr, SGV->getName(),
+ /*insertbefore*/ nullptr,
+ SGV->getThreadLocalMode(), SGV->getAddressSpace());
}
if (ForDefinition)
GlobalVariable *NG = new GlobalVariable(
DstM, NewType, SrcGV->isConstant(), SrcGV->getLinkage(),
/*init*/ nullptr, /*name*/ "", DstGV, SrcGV->getThreadLocalMode(),
- SrcGV->getType()->getAddressSpace());
+ SrcGV->getAddressSpace());
NG->copyAttributesFrom(SrcGV);
forceRenaming(NG, SrcGV->getName());