diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-07-02 11:25:17 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-07-02 11:25:17 +0000 |
commit | 80909878adc79d9f1277373af175041718f05953 (patch) | |
tree | c673079a9bf2cc7e6d7635625bdb1691e162686b /clang/lib/AST/Stmt.cpp | |
parent | 3937bc650cad69cbd607ca3ea64ea6623808fc19 (diff) | |
download | bcm5719-llvm-80909878adc79d9f1277373af175041718f05953.tar.gz bcm5719-llvm-80909878adc79d9f1277373af175041718f05953.zip |
[OPENMP 4.0] Initial support for 'omp cancel' construct.
Implemented parsing/sema analysis + (de)serialization.
llvm-svn: 241253
Diffstat (limited to 'clang/lib/AST/Stmt.cpp')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index 911ec5e30ef..c0aab4c4db7 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -2106,6 +2106,26 @@ OMPCancellationPointDirective::CreateEmpty(const ASTContext &C, EmptyShell) { return new (Mem) OMPCancellationPointDirective(); } +OMPCancelDirective * +OMPCancelDirective::Create(const ASTContext &C, SourceLocation StartLoc, + SourceLocation EndLoc, + OpenMPDirectiveKind CancelRegion) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPCancelDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size); + OMPCancelDirective *Dir = new (Mem) OMPCancelDirective(StartLoc, EndLoc); + Dir->setCancelRegion(CancelRegion); + return Dir; +} + +OMPCancelDirective *OMPCancelDirective::CreateEmpty(const ASTContext &C, + EmptyShell) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPCancelDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size); + return new (Mem) OMPCancelDirective(); +} + OMPFlushDirective *OMPFlushDirective::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, |