diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-21 19:35:27 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-03-21 19:35:27 +0000 |
commit | c56872589f1593eb0e6ccd9ee2c3e1be0c947e08 (patch) | |
tree | ba3b62382592b0398821ef5f5243370f75ff34ac /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 5988d72243bc03cb3a0b3f141cf21fd54596bd63 (diff) | |
download | bcm5719-llvm-c56872589f1593eb0e6ccd9ee2c3e1be0c947e08.tar.gz bcm5719-llvm-c56872589f1593eb0e6ccd9ee2c3e1be0c947e08.zip |
[OPENMP]Codegen support for allocate directive on global variables.
For the global variables the allocate directive must specify only the
predefined allocator. This allocator must be translated into the correct
form of the address space for the targets that support different address
spaces.
llvm-svn: 356702
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3a9df23a495..b9d4ee9f8c4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -3387,6 +3387,11 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) { return LangAS::cuda_device; } + if (LangOpts.OpenMP) { + LangAS AS; + if (OpenMPRuntime->hasAllocateAttributeForGlobalVar(D, AS)) + return AS; + } return getTargetCodeGenInfo().getGlobalVarAddressSpace(*this, D); } |