mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-02 05:02:15 +00:00
[IRMover] Use GlobalValue::getAddressSpace instead of directly from its type [NFC]
Summary: Change the old form of G->getType()->getAddressSpace() to the new G->getAddressSpace() (underneath does the same). Patch by Ehud Katz <ehudkatz@gmail.com> Reviewers: tejohnson, chandlerc Reviewed By: tejohnson Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69550
This commit is contained in:
parent
37f4955c9b
commit
dce53d7198
@ -628,7 +628,7 @@ GlobalVariable *IRLinker::copyGlobalVariableProto(const GlobalVariable *SGVar) {
|
||||
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;
|
||||
@ -671,11 +671,11 @@ IRLinker::copyGlobalIndirectSymbolProto(const GlobalIndirectSymbol *SGIS) {
|
||||
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);
|
||||
@ -697,12 +697,12 @@ GlobalValue *IRLinker::copyGlobalValueProto(const GlobalValue *SGV,
|
||||
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)
|
||||
@ -918,7 +918,7 @@ IRLinker::linkAppendingVarProto(GlobalVariable *DstGV,
|
||||
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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user