summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorMichael Wong <fraggamuffin@gmail.com>2015-07-21 13:44:28 +0000
committerMichael Wong <fraggamuffin@gmail.com>2015-07-21 13:44:28 +0000
commit65f367fcbbf38e599b2f747ca101c97d40c6420d (patch)
treefb0045186e3262cb10d2e591043d47cbba1c2b18 /clang/lib/CodeGen
parentfbb86b2350e58876c243c882b3315c45888453dc (diff)
downloadbcm5719-llvm-65f367fcbbf38e599b2f747ca101c97d40c6420d.tar.gz
bcm5719-llvm-65f367fcbbf38e599b2f747ca101c97d40c6420d.zip
Commit for http://reviews.llvm.org/D10765
for OpenMP 4 target data directive parsing and sema. This commit is on behalf of Kelvin Li. llvm-svn: 242785
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp3
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp9
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h1
3 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index f58c2f440a6..d3fa7f27c5c 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -246,6 +246,9 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
case Stmt::OMPCancelDirectiveClass:
EmitOMPCancelDirective(cast<OMPCancelDirective>(*S));
break;
+ case Stmt::OMPTargetDataDirectiveClass:
+ EmitOMPTargetDataDirective(cast<OMPTargetDataDirective>(*S));
+ break;
}
}
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index b11372bbcb7..2069e9a2974 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -2121,3 +2121,12 @@ CodeGenFunction::getOMPCancelDestination(OpenMPDirectiveKind Kind) {
: BreakContinueStack.back().BreakBlock;
return JumpDest();
}
+
+// Generate the instructions for '#pragma omp target data' directive.
+void CodeGenFunction::EmitOMPTargetDataDirective(
+ const OMPTargetDataDirective &S) {
+
+ // emit the code inside the construct for now
+ auto CS = cast<CapturedStmt>(S.getAssociatedStmt());
+ EmitStmt(CS->getCapturedStmt());
+}
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index b8e97ac261d..1144a82c9f9 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2213,6 +2213,7 @@ public:
void EmitOMPOrderedDirective(const OMPOrderedDirective &S);
void EmitOMPAtomicDirective(const OMPAtomicDirective &S);
void EmitOMPTargetDirective(const OMPTargetDirective &S);
+ void EmitOMPTargetDataDirective(const OMPTargetDataDirective &S);
void EmitOMPTeamsDirective(const OMPTeamsDirective &S);
void
EmitOMPCancellationPointDirective(const OMPCancellationPointDirective &S);
OpenPOWER on IntegriCloud