diff options
| author | Samuel Antao <sfantao@us.ibm.com> | 2016-01-19 20:04:50 +0000 |
|---|---|---|
| committer | Samuel Antao <sfantao@us.ibm.com> | 2016-01-19 20:04:50 +0000 |
| commit | 725907603205e62fc02e2cfc40cdf3719774bf6f (patch) | |
| tree | 4515b906368a389bc63fc7bff38b860c2165b266 /clang/lib/AST | |
| parent | d4af297df1b0dc442622494214c67fb4a9848d43 (diff) | |
| download | bcm5719-llvm-725907603205e62fc02e2cfc40cdf3719774bf6f.tar.gz bcm5719-llvm-725907603205e62fc02e2cfc40cdf3719774bf6f.zip | |
[OpenMP] Parsing + sema for "target exit data" directive.
Patch by Arpith Jacob. Thanks!
llvm-svn: 258177
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/StmtOpenMP.cpp | 22 | ||||
| -rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 5 |
3 files changed, 33 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtOpenMP.cpp b/clang/lib/AST/StmtOpenMP.cpp index b3dfd251692..4ac2ca2abd0 100644 --- a/clang/lib/AST/StmtOpenMP.cpp +++ b/clang/lib/AST/StmtOpenMP.cpp @@ -737,6 +737,28 @@ OMPTargetEnterDataDirective::CreateEmpty(const ASTContext &C, unsigned N, return new (Mem) OMPTargetEnterDataDirective(N); } +OMPTargetExitDataDirective * +OMPTargetExitDataDirective::Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation EndLoc, + ArrayRef<OMPClause *> Clauses) { + void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective), + llvm::alignOf<OMPClause *>()) + + sizeof(OMPClause *) * Clauses.size()); + OMPTargetExitDataDirective *Dir = + new (Mem) OMPTargetExitDataDirective(StartLoc, EndLoc, Clauses.size()); + Dir->setClauses(Clauses); + return Dir; +} + +OMPTargetExitDataDirective * +OMPTargetExitDataDirective::CreateEmpty(const ASTContext &C, unsigned N, + EmptyShell) { + void *Mem = C.Allocate(llvm::alignTo(sizeof(OMPTargetExitDataDirective), + llvm::alignOf<OMPClause *>()) + + sizeof(OMPClause *) * N); + return new (Mem) OMPTargetExitDataDirective(N); +} + OMPTeamsDirective *OMPTeamsDirective::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 2e8da360c94..927fdeb8de0 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1067,6 +1067,12 @@ void StmtPrinter::VisitOMPTargetEnterDataDirective( PrintOMPExecutableDirective(Node); } +void StmtPrinter::VisitOMPTargetExitDataDirective( + OMPTargetExitDataDirective *Node) { + Indent() << "#pragma omp target exit data "; + PrintOMPExecutableDirective(Node); +} + void StmtPrinter::VisitOMPTeamsDirective(OMPTeamsDirective *Node) { Indent() << "#pragma omp teams "; PrintOMPExecutableDirective(Node); diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 9ab9c8e1217..2ea0243f12a 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -589,6 +589,11 @@ void StmtProfiler::VisitOMPTargetEnterDataDirective( VisitOMPExecutableDirective(S); } +void StmtProfiler::VisitOMPTargetExitDataDirective( + const OMPTargetExitDataDirective *S) { + VisitOMPExecutableDirective(S); +} + void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) { VisitOMPExecutableDirective(S); } |

