diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-26 08:21:58 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-26 08:21:58 +0000 |
commit | 1e0498a92d6e09d01c791a7f32299de6c8e02cac (patch) | |
tree | 80b5da2548f93a8a8f193b07da7851a496adb24d /clang/lib/AST | |
parent | 07910d6ab548e7a57717af7e28d994cd652fd75d (diff) | |
download | bcm5719-llvm-1e0498a92d6e09d01c791a7f32299de6c8e02cac.tar.gz bcm5719-llvm-1e0498a92d6e09d01c791a7f32299de6c8e02cac.zip |
[OPENMP] Initial parsing and sema analysis for 'section' directive.
llvm-svn: 211767
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 48b3dc5baf4..b402f6edd25 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -1410,3 +1410,23 @@ OMPSectionsDirective *OMPSectionsDirective::CreateEmpty(const ASTContext &C, return new (Mem) OMPSectionsDirective(NumClauses); } +OMPSectionDirective *OMPSectionDirective::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation EndLoc, + Stmt *AssociatedStmt) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPSectionsDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size + sizeof(Stmt *)); + OMPSectionDirective *Dir = new (Mem) OMPSectionDirective(StartLoc, EndLoc); + Dir->setAssociatedStmt(AssociatedStmt); + return Dir; +} + +OMPSectionDirective *OMPSectionDirective::CreateEmpty(const ASTContext &C, + EmptyShell) { + unsigned Size = llvm::RoundUpToAlignment(sizeof(OMPSectionDirective), + llvm::alignOf<Stmt *>()); + void *Mem = C.Allocate(Size + sizeof(Stmt *)); + return new (Mem) OMPSectionDirective(); +} + diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 46e9cbdc3d9..0ac683347f0 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -792,6 +792,11 @@ void StmtPrinter::VisitOMPSectionsDirective(OMPSectionsDirective *Node) { PrintOMPExecutableDirective(Node); } +void StmtPrinter::VisitOMPSectionDirective(OMPSectionDirective *Node) { + Indent() << "#pragma omp section"; + PrintOMPExecutableDirective(Node); +} + //===----------------------------------------------------------------------===// // Expr printing methods. //===----------------------------------------------------------------------===// diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 0a9a011b93a..804003fb678 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -364,6 +364,10 @@ void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) { VisitOMPExecutableDirective(S); } +void StmtProfiler::VisitOMPSectionDirective(const OMPSectionDirective *S) { + VisitOMPExecutableDirective(S); +} + void StmtProfiler::VisitExpr(const Expr *S) { VisitStmt(S); } |