diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-03-18 12:19:12 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-03-18 12:19:12 +0000 |
commit | 750a58bcd97f6f8e9d6997c1723f73ff7cb8f55e (patch) | |
tree | 77f401868242fb36d66ed07d1df3f86b0c1a9093 /clang | |
parent | 213bb0024564cbd0119452bd1c21b273857b9531 (diff) | |
download | bcm5719-llvm-750a58bcd97f6f8e9d6997c1723f73ff7cb8f55e.tar.gz bcm5719-llvm-750a58bcd97f6f8e9d6997c1723f73ff7cb8f55e.zip |
[OPENMP] DSA fix
llvm-svn: 204143
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 9fb7522ce51..1e1dbfed0b8 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -134,7 +134,22 @@ DSAStackTy::DSAVarData DSAStackTy::getDSA(StackTy::reverse_iterator Iter, VarDecl *D) { DSAVarData DVar; if (Iter == Stack.rend() - 1) { - DVar.CKind = OMPC_shared; + // OpenMP [2.9.1.1, Data-sharing Attribute Rules for Variables Referenced + // in a region but not in construct] + // File-scope or namespace-scope variables referenced in called routines + // in the region are shared unless they appear in a threadprivate + // directive. + // TODO + if (!D->isFunctionOrMethodVarDecl()) + DVar.CKind = OMPC_shared; + + // OpenMP [2.9.1.2, Data-sharing Attribute Rules for Variables Referenced + // in a region but not in construct] + // Variables with static storage duration that are declared in called + // routines in the region are shared. + if (D->hasGlobalStorage()) + DVar.CKind = OMPC_shared; + return DVar; } |