diff options
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/Stmt.cpp | 20 | ||||
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 5 | ||||
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 4 |
3 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index b415e9201e5..9185e4870e0 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1478,6 +1478,26 @@ OMPSingleDirective *OMPSingleDirective::CreateEmpty(const ASTContext &C, return new (Mem) OMPSingleDirective(NumClauses); } +OMPMasterDirective *OMPMasterDirective::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation EndLoc, + Stmt *AssociatedStmt) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPMasterDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size + sizeof(Stmt *)); + OMPMasterDirective *Dir = new (Mem) OMPMasterDirective(StartLoc, EndLoc); + Dir->setAssociatedStmt(AssociatedStmt); + return Dir; +} + +OMPMasterDirective *OMPMasterDirective::CreateEmpty(const ASTContext &C, + EmptyShell) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPMasterDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size + sizeof(Stmt *)); + return new (Mem) OMPMasterDirective(); +} + OMPParallelForDirective * OMPParallelForDirective::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, unsigned CollapsedNum, diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 5958dacf3a8..fd511ef465d 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -821,6 +821,11 @@ void StmtPrinter::VisitOMPSingleDirective(OMPSingleDirective *Node) { PrintOMPExecutableDirective(Node); } +void StmtPrinter::VisitOMPMasterDirective(OMPMasterDirective *Node) { + Indent() << "#pragma omp master"; + PrintOMPExecutableDirective(Node); +} + void StmtPrinter::VisitOMPParallelForDirective(OMPParallelForDirective *Node) { Indent() << "#pragma omp parallel for "; PrintOMPExecutableDirective(Node); diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index d0c39a5f340..c45281f13f4 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -385,6 +385,10 @@ void StmtProfiler::VisitOMPSingleDirective(const OMPSingleDirective *S) { VisitOMPExecutableDirective(S); } +void StmtProfiler::VisitOMPMasterDirective(const OMPMasterDirective *S) { + VisitOMPExecutableDirective(S); +} + void StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) { VisitOMPExecutableDirective(S); |