diff options
Diffstat (limited to 'lib/AST/StmtProfile.cpp')
-rw-r--r-- | lib/AST/StmtProfile.cpp | 76 |
1 files changed, 69 insertions, 7 deletions
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index f44f25c..d1f25d6 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -310,18 +310,38 @@ void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {} void OMPClauseProfiler::VisitOMPMergeableClause(const OMPMergeableClause *) {} +void OMPClauseProfiler::VisitOMPReadClause(const OMPReadClause *) {} + +void OMPClauseProfiler::VisitOMPWriteClause(const OMPWriteClause *) {} + +void OMPClauseProfiler::VisitOMPUpdateClause(const OMPUpdateClause *) {} + +void OMPClauseProfiler::VisitOMPCaptureClause(const OMPCaptureClause *) {} + +void OMPClauseProfiler::VisitOMPSeqCstClause(const OMPSeqCstClause *) {} + template<typename T> void OMPClauseProfiler::VisitOMPClauseList(T *Node) { - for (auto *I : Node->varlists()) - Profiler->VisitStmt(I); + for (auto *E : Node->varlists()) { + Profiler->VisitStmt(E); + } } void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) { VisitOMPClauseList(C); + for (auto *E : C->private_copies()) { + Profiler->VisitStmt(E); + } } -void OMPClauseProfiler::VisitOMPFirstprivateClause( - const OMPFirstprivateClause *C) { +void +OMPClauseProfiler::VisitOMPFirstprivateClause(const OMPFirstprivateClause *C) { VisitOMPClauseList(C); + for (auto *E : C->private_copies()) { + Profiler->VisitStmt(E); + } + for (auto *E : C->inits()) { + Profiler->VisitStmt(E); + } } void OMPClauseProfiler::VisitOMPLastprivateClause(const OMPLastprivateClause *C) { @@ -368,16 +388,24 @@ StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) { P.Visit(*I); } +void StmtProfiler::VisitOMPLoopDirective(const OMPLoopDirective *S) { + VisitOMPExecutableDirective(S); +} + void StmtProfiler::VisitOMPParallelDirective(const OMPParallelDirective *S) { VisitOMPExecutableDirective(S); } void StmtProfiler::VisitOMPSimdDirective(const OMPSimdDirective *S) { - VisitOMPExecutableDirective(S); + VisitOMPLoopDirective(S); } void StmtProfiler::VisitOMPForDirective(const OMPForDirective *S) { - VisitOMPExecutableDirective(S); + VisitOMPLoopDirective(S); +} + +void StmtProfiler::VisitOMPForSimdDirective(const OMPForSimdDirective *S) { + VisitOMPLoopDirective(S); } void StmtProfiler::VisitOMPSectionsDirective(const OMPSectionsDirective *S) { @@ -403,7 +431,12 @@ void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) { void StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) { - VisitOMPExecutableDirective(S); + VisitOMPLoopDirective(S); +} + +void StmtProfiler::VisitOMPParallelForSimdDirective( + const OMPParallelForSimdDirective *S) { + VisitOMPLoopDirective(S); } void StmtProfiler::VisitOMPParallelSectionsDirective( @@ -431,6 +464,22 @@ void StmtProfiler::VisitOMPFlushDirective(const OMPFlushDirective *S) { VisitOMPExecutableDirective(S); } +void StmtProfiler::VisitOMPOrderedDirective(const OMPOrderedDirective *S) { + VisitOMPExecutableDirective(S); +} + +void StmtProfiler::VisitOMPAtomicDirective(const OMPAtomicDirective *S) { + VisitOMPExecutableDirective(S); +} + +void StmtProfiler::VisitOMPTargetDirective(const OMPTargetDirective *S) { + VisitOMPExecutableDirective(S); +} + +void StmtProfiler::VisitOMPTeamsDirective(const OMPTeamsDirective *S) { + VisitOMPExecutableDirective(S); +} + void StmtProfiler::VisitExpr(const Expr *S) { VisitStmt(S); } @@ -452,6 +501,7 @@ void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) { void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) { VisitExpr(S); S->getValue().Profile(ID); + ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind()); } void StmtProfiler::VisitCharacterLiteral(const CharacterLiteral *S) { @@ -464,6 +514,7 @@ void StmtProfiler::VisitFloatingLiteral(const FloatingLiteral *S) { VisitExpr(S); S->getValue().Profile(ID); ID.AddBoolean(S->isExact()); + ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind()); } void StmtProfiler::VisitImaginaryLiteral(const ImaginaryLiteral *S) { @@ -1018,6 +1069,8 @@ StmtProfiler::VisitLambdaExpr(const LambdaExpr *S) { VisitDecl(C->getCapturedVar()); ID.AddBoolean(C->isPackExpansion()); break; + case LCK_VLAType: + llvm_unreachable("VLA type in explicit captures."); } } // Note: If we actually needed to be able to match lambda @@ -1187,10 +1240,19 @@ void StmtProfiler::VisitMaterializeTemporaryExpr( VisitExpr(S); } +void StmtProfiler::VisitCXXFoldExpr(const CXXFoldExpr *S) { + VisitExpr(S); + ID.AddInteger(S->getOperator()); +} + void StmtProfiler::VisitOpaqueValueExpr(const OpaqueValueExpr *E) { VisitExpr(E); } +void StmtProfiler::VisitTypoExpr(const TypoExpr *E) { + VisitExpr(E); +} + void StmtProfiler::VisitObjCStringLiteral(const ObjCStringLiteral *S) { VisitExpr(S); } |