diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-04-02 19:44:46 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-04-02 19:44:46 +0000 |
commit | 0fd3c68c1a753f947fd91d5aad3a366234fb6f3d (patch) | |
tree | c985cf9201042bfac63e4d0736bca0d21b08ca17 /clang/lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | a31347f17d1f03d01845e7d433d24dedd3dec8e0 (diff) | |
download | bcm5719-llvm-0fd3c68c1a753f947fd91d5aad3a366234fb6f3d.tar.gz bcm5719-llvm-0fd3c68c1a753f947fd91d5aad3a366234fb6f3d.zip |
[OPENMP]Add codegen for private vars with allocate clause.
Added codegen/test for the privatized variables with the allocate
clause.
llvm-svn: 357514
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index 8e23dcd2d20..65c5c1ca300 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -9761,13 +9761,9 @@ Address CGOpenMPRuntime::getAddressOfLocalVariable(CodeGenFunction &CGF, return Address::invalid(); const auto *AA = CVD->getAttr<OMPAllocateDeclAttr>(); // Use the default allocation. - if (AA->getAllocatorType() == OMPAllocateDeclAttr::OMPDefaultMemAlloc) + if (AA->getAllocatorType() == OMPAllocateDeclAttr::OMPDefaultMemAlloc && + !AA->getAllocator()) return Address::invalid(); - auto &Elem = OpenMPLocThreadIDMap.FindAndConstruct(CGF.CurFn); - if (!Elem.second.ServiceInsertPt) - setLocThreadIdInsertPt(CGF); - CGBuilderTy::InsertPointGuard IPG(CGF.Builder); - CGF.Builder.SetInsertPoint(Elem.second.ServiceInsertPt); llvm::Value *Size; CharUnits Align = CGM.getContext().getDeclAlign(CVD); if (CVD->getType()->isVariablyModifiedType()) { |