summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2013-09-24 03:17:45 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2013-09-24 03:17:45 +0000
commit756c196f1463f2c666f853aecb20e198d8af010d (patch)
tree8643031801147465637162c6ebf28724f76fc425 /clang/lib/AST/StmtProfile.cpp
parent036f16dc8c494efca4a342703fd572b6de76a1fa (diff)
downloadbcm5719-llvm-756c196f1463f2c666f853aecb20e198d8af010d.tar.gz
bcm5719-llvm-756c196f1463f2c666f853aecb20e198d8af010d.zip
[OPENMP] Bug fixes and improvements.
1. Fixed constructor of shared clause. 2. Some macros for clauses processing are replaced by private template methods. 3. Additional checks in sema analysis of OpenMP clauses. llvm-svn: 191265
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r--clang/lib/AST/StmtProfile.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 9591127b8af..cde95ee3514 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -255,6 +255,9 @@ StmtProfiler::VisitObjCAutoreleasePoolStmt(const ObjCAutoreleasePoolStmt *S) {
namespace {
class OMPClauseProfiler : public ConstOMPClauseVisitor<OMPClauseProfiler> {
StmtProfiler *Profiler;
+ /// \brief Process clauses with list of variables.
+ template <typename T>
+ void VisitOMPClauseList(T *Node);
public:
OMPClauseProfiler(StmtProfiler *P) : Profiler(P) { }
#define OPENMP_CLAUSE(Name, Class) \
@@ -263,19 +266,21 @@ public:
};
void OMPClauseProfiler::VisitOMPDefaultClause(const OMPDefaultClause *C) { }
-#define PROCESS_OMP_CLAUSE_LIST(Class, Node) \
- for (OMPVarList<Class>::varlist_const_iterator I = Node->varlist_begin(), \
- E = Node->varlist_end(); \
- I != E; ++I) \
+
+template<typename T>
+void OMPClauseProfiler::VisitOMPClauseList(T *Node) {
+ for (typename T::varlist_const_iterator I = Node->varlist_begin(),
+ E = Node->varlist_end();
+ I != E; ++I)
Profiler->VisitStmt(*I);
+}
void OMPClauseProfiler::VisitOMPPrivateClause(const OMPPrivateClause *C) {
- PROCESS_OMP_CLAUSE_LIST(OMPPrivateClause, C)
+ VisitOMPClauseList(C);
}
void OMPClauseProfiler::VisitOMPSharedClause(const OMPSharedClause *C) {
- PROCESS_OMP_CLAUSE_LIST(OMPSharedClause, C)
+ VisitOMPClauseList(C);
}
-#undef PROCESS_OMP_CLAUSE_LIST
}
void
OpenPOWER on IntegriCloud