diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-11-05 13:07:20 -0800 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-11-05 13:54:41 -0800 |
commit | dce53d71987d9c44360d8a8d995ca2ad042f990f (patch) | |
tree | 27b1aec60a1bfd17629b4ade2fd9d03cb32bd2fe | |
parent | 37f4955c9baba9f981100b3137cb9486c0d75ce8 (diff) | |
download | bcm5719-llvm-dce53d71987d9c44360d8a8d995ca2ad042f990f.tar.gz bcm5719-llvm-dce53d71987d9c44360d8a8d995ca2ad042f990f.zip |
[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
-rw-r--r-- | llvm/lib/Linker/IRMover.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp index 6784d81595e..1cef0e84a30 100644 --- a/llvm/lib/Linker/IRMover.cpp +++ b/llvm/lib/Linker/IRMover.cpp @@ -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()); |