summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-02-25 05:25:57 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-02-25 05:25:57 +0000
commit005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d (patch)
treeae4d8331e3ca9ecea9de2420509ab715a87e80d2 /clang/lib/AST/StmtProfile.cpp
parent640dc752a9445f67f3955475433b9fa2bbf9de98 (diff)
downloadbcm5719-llvm-005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d.tar.gz
bcm5719-llvm-005248ac8adf63d4a6a46b1f6cdb9fea686a2f9d.zip
[OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.
OpenMP 4.5 allows to privatize non-static member decls in non-static member functions. Patch captures such decls by reference in general (for bitfields, by value) and then operates with this capture. For bitfields, at the end of codegen for lastprivates original bitfield is updated with the value of captured copy. llvm-svn: 261824
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r--clang/lib/AST/StmtProfile.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index d106969efe6..4686483871d 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -269,6 +269,7 @@ public:
void Visit##Class(const Class *C);
#include "clang/Basic/OpenMPKinds.def"
void VistOMPClauseWithPreInit(const OMPClauseWithPreInit *C);
+ void VistOMPClauseWithPostUpdate(const OMPClauseWithPostUpdate *C);
};
void OMPClauseProfiler::VistOMPClauseWithPreInit(
@@ -277,6 +278,12 @@ void OMPClauseProfiler::VistOMPClauseWithPreInit(
Profiler->VisitStmt(S);
}
+void OMPClauseProfiler::VistOMPClauseWithPostUpdate(
+ const OMPClauseWithPostUpdate *C) {
+ if (auto *E = C->getPostUpdateExpr())
+ Profiler->VisitStmt(E);
+}
+
void OMPClauseProfiler::VisitOMPIfClause(const OMPIfClause *C) {
if (C->getCondition())
Profiler->VisitStmt(C->getCondition());
@@ -371,6 +378,8 @@ OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) {
void
OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) {
VisitOMPClauseList(C);
+ VistOMPClauseWithPreInit(C);
+ VistOMPClauseWithPostUpdate(C);
for (auto *E : C->source_exprs()) {
Profiler->VisitStmt(E);
}
OpenPOWER on IntegriCloud