diff options
author | Michael Liao <michael.hliao@gmail.com> | 2019-06-07 15:08:29 -0400 |
---|---|---|
committer | Michael Liao <michael.hliao@gmail.com> | 2019-11-05 14:19:32 -0500 |
commit | 0a220de9e9ca3e6786df6c03fd37668815805c62 (patch) | |
tree | 8e6530e9146db52615db6c5b0a351cab4378d38b /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 6cd47f9dd7dd664ff855fb0d1ed26bf5e4bb77fc (diff) | |
download | bcm5719-llvm-0a220de9e9ca3e6786df6c03fd37668815805c62.tar.gz bcm5719-llvm-0a220de9e9ca3e6786df6c03fd37668815805c62.zip |
[HIP] Fix visibility for 'extern' device variables.
Summary:
- Fix a bug which misses the change for a variable to be set with
target-specific attributes.
Reviewers: yaxunl
Subscribers: jvesely, nhaehnle, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D63020
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 49df82cea42..be8f389e180 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3575,6 +3575,9 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, } } + if (GV->isDeclaration()) + getTargetCodeGenInfo().setTargetAttributes(D, GV, *this); + LangAS ExpectedAS = D ? D->getType().getAddressSpace() : (LangOpts.OpenCL ? LangAS::opencl_global : LangAS::Default); @@ -3584,9 +3587,6 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, return getTargetCodeGenInfo().performAddrSpaceCast(*this, GV, AddrSpace, ExpectedAS, Ty); - if (GV->isDeclaration()) - getTargetCodeGenInfo().setTargetAttributes(D, GV, *this); - return GV; } |