diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-03-25 16:36:57 -0400 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2022-03-25 22:44:17 -0400 |
commit | 3c6d32ec6cdb426d531e0a3b3aa4449ff6e4d75c (patch) | |
tree | dda28d1bec25d3f4bad54e39081c092b5fbc1579 /clang/lib/CodeGen/CodeGenModule.h | |
parent | e13faa40cf0a727a76e395ab4123b9d2ca527b49 (diff) | |
download | llvm-3c6d32ec6cdb426d531e0a3b3aa4449ff6e4d75c.zip llvm-3c6d32ec6cdb426d531e0a3b3aa4449ff6e4d75c.tar.gz llvm-3c6d32ec6cdb426d531e0a3b3aa4449ff6e4d75c.tar.bz2 |
[OpenMP] Make Ctor / Dtor functions have external visibility
The default construction of constructor functions by LLVM tends to make
them have internal linkage. When we call a ctor / dtor function in the
target region we are actually creating a kernel that is called at
registration. Because the ctor is a kernel we need to make sure it's
externally visible so we can actually call it. This prevented AMDGPU
from correctly using constructors while NVPTX could use them simply
because it ignored internal visibility.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D122504
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 1fcd5d4d..b04393e 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -826,7 +826,9 @@ public: llvm::Function *CreateGlobalInitOrCleanUpFunction( llvm::FunctionType *ty, const Twine &name, const CGFunctionInfo &FI, - SourceLocation Loc = SourceLocation(), bool TLS = false); + SourceLocation Loc = SourceLocation(), bool TLS = false, + llvm::GlobalVariable::LinkageTypes Linkage = + llvm::GlobalVariable::InternalLinkage); /// Return the AST address space of the underlying global variable for D, as /// determined by its declaration. Normally this is the same as the address |