diff options
author | Itay Bookstein <itay.bookstein@nextsilicon.com> | 2020-06-16 16:17:27 -0700 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2020-06-16 20:15:27 -0700 |
commit | df9d64ed9c1d819bc0a040e3ef4c4a4003bf5c93 (patch) | |
tree | d5ae704412557bc5c9c9525f6555488b1b298230 /llvm/lib/IR/Globals.cpp | |
parent | 3b34f3fccac93697065df620d454fcadceb4fa6e (diff) | |
download | llvm-df9d64ed9c1d819bc0a040e3ef4c4a4003bf5c93.zip llvm-df9d64ed9c1d819bc0a040e3ef4c4a4003bf5c93.tar.gz llvm-df9d64ed9c1d819bc0a040e3ef4c4a4003bf5c93.tar.bz2 |
[IR] Add missing GlobalAlias copying of ThreadLocalMode attribute
Summary:
Previously, GlobalAlias::copyAttributesFrom did not preserve ThreadLocalMode,
causing incorrect IR generation in IR linking flows. This patch pushes the code
responsible for copying this attribute from GlobalVariable::copyAttributesFrom
down to GlobalValue::copyAttributesFrom so that it is shared by GlobalAlias.
Fixes PR46297.
Reviewers: tejohnson, pcc, hans
Reviewed By: tejohnson, hans
Subscribers: hiraditya, ibookstein, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81605
Diffstat (limited to 'llvm/lib/IR/Globals.cpp')
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index eefd221..34c767f 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -65,6 +65,7 @@ Value *GlobalValue::handleOperandChangeImpl(Value *From, Value *To) { void GlobalValue::copyAttributesFrom(const GlobalValue *Src) { setVisibility(Src->getVisibility()); setUnnamedAddr(Src->getUnnamedAddr()); + setThreadLocalMode(Src->getThreadLocalMode()); setDLLStorageClass(Src->getDLLStorageClass()); setDSOLocal(Src->isDSOLocal()); setPartition(Src->getPartition()); @@ -419,7 +420,6 @@ void GlobalVariable::setInitializer(Constant *InitVal) { /// from the GlobalVariable Src to this one. void GlobalVariable::copyAttributesFrom(const GlobalVariable *Src) { GlobalObject::copyAttributesFrom(Src); - setThreadLocalMode(Src->getThreadLocalMode()); setExternallyInitialized(Src->isExternallyInitialized()); setAttributes(Src->getAttributes()); } |