summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-03-21 19:35:27 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-03-21 19:35:27 +0000
commitc56872589f1593eb0e6ccd9ee2c3e1be0c947e08 (patch)
treeba3b62382592b0398821ef5f5243370f75ff34ac /clang/lib/CodeGen/CodeGenModule.cpp
parent5988d72243bc03cb3a0b3f141cf21fd54596bd63 (diff)
downloadbcm5719-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.cpp5
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);
}
OpenPOWER on IntegriCloud