summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlexander Musman <alexander.musman@gmail.com>2014-08-19 11:27:13 +0000
committerAlexander Musman <alexander.musman@gmail.com>2014-08-19 11:27:13 +0000
commit3aaab669c82c246f6cf452a3667d619419343339 (patch)
treee1e39b1cb546e346177306723d82297d667a4fcb /clang/lib
parent960507beb4666d2289cd78f160ff9074cd1225ad (diff)
downloadbcm5719-llvm-3aaab669c82c246f6cf452a3667d619419343339.tar.gz
bcm5719-llvm-3aaab669c82c246f6cf452a3667d619419343339.zip
[OPENMP] Extract common superclass from all the loop directives. No functional changes (having common superclass is convenient for future loop directives CodeGen implementation)
llvm-svn: 215975
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/StmtProfile.cpp10
-rw-r--r--clang/lib/Serialization/ASTReaderStmt.cpp22
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp22
3 files changed, 27 insertions, 27 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 76c7843481a..5550d6d97b0 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -378,16 +378,20 @@ 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::VisitOMPSectionsDirective(const OMPSectionsDirective *S) {
@@ -413,7 +417,7 @@ void StmtProfiler::VisitOMPCriticalDirective(const OMPCriticalDirective *S) {
void
StmtProfiler::VisitOMPParallelForDirective(const OMPParallelForDirective *S) {
- VisitOMPExecutableDirective(S);
+ VisitOMPLoopDirective(S);
}
void StmtProfiler::VisitOMPParallelSectionsDirective(
diff --git a/clang/lib/Serialization/ASTReaderStmt.cpp b/clang/lib/Serialization/ASTReaderStmt.cpp
index c22bc3eff33..81fc79a5504 100644
--- a/clang/lib/Serialization/ASTReaderStmt.cpp
+++ b/clang/lib/Serialization/ASTReaderStmt.cpp
@@ -1963,6 +1963,13 @@ void ASTStmtReader::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
E->setAssociatedStmt(Reader.ReadSubStmt());
}
+void ASTStmtReader::VisitOMPLoopDirective(OMPLoopDirective *D) {
+ VisitStmt(D);
+ // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
+ Idx += 2;
+ VisitOMPExecutableDirective(D);
+}
+
void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
VisitStmt(D);
// The NumClauses field was read in ReadStmtFromStream.
@@ -1971,17 +1978,11 @@ void ASTStmtReader::VisitOMPParallelDirective(OMPParallelDirective *D) {
}
void ASTStmtReader::VisitOMPSimdDirective(OMPSimdDirective *D) {
- VisitStmt(D);
- // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
- Idx += 2;
- VisitOMPExecutableDirective(D);
+ VisitOMPLoopDirective(D);
}
void ASTStmtReader::VisitOMPForDirective(OMPForDirective *D) {
- VisitStmt(D);
- // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
- Idx += 2;
- VisitOMPExecutableDirective(D);
+ VisitOMPLoopDirective(D);
}
void ASTStmtReader::VisitOMPSectionsDirective(OMPSectionsDirective *D) {
@@ -2015,10 +2016,7 @@ void ASTStmtReader::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
}
void ASTStmtReader::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
- VisitStmt(D);
- // Two fields (NumClauses and CollapsedNum) were read in ReadStmtFromStream.
- Idx += 2;
- VisitOMPExecutableDirective(D);
+ VisitOMPLoopDirective(D);
}
void ASTStmtReader::VisitOMPParallelSectionsDirective(
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index f77f4b947c1..2cda8efa17b 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -1842,26 +1842,27 @@ void ASTStmtWriter::VisitOMPExecutableDirective(OMPExecutableDirective *E) {
Writer.AddStmt(E->getAssociatedStmt());
}
-void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
+void ASTStmtWriter::VisitOMPLoopDirective(OMPLoopDirective *D) {
VisitStmt(D);
Record.push_back(D->getNumClauses());
+ Record.push_back(D->getCollapsedNumber());
VisitOMPExecutableDirective(D);
- Code = serialization::STMT_OMP_PARALLEL_DIRECTIVE;
}
-void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
+void ASTStmtWriter::VisitOMPParallelDirective(OMPParallelDirective *D) {
VisitStmt(D);
Record.push_back(D->getNumClauses());
- Record.push_back(D->getCollapsedNumber());
VisitOMPExecutableDirective(D);
+ Code = serialization::STMT_OMP_PARALLEL_DIRECTIVE;
+}
+
+void ASTStmtWriter::VisitOMPSimdDirective(OMPSimdDirective *D) {
+ VisitOMPLoopDirective(D);
Code = serialization::STMT_OMP_SIMD_DIRECTIVE;
}
void ASTStmtWriter::VisitOMPForDirective(OMPForDirective *D) {
- VisitStmt(D);
- Record.push_back(D->getNumClauses());
- Record.push_back(D->getCollapsedNumber());
- VisitOMPExecutableDirective(D);
+ VisitOMPLoopDirective(D);
Code = serialization::STMT_OMP_FOR_DIRECTIVE;
}
@@ -1899,10 +1900,7 @@ void ASTStmtWriter::VisitOMPCriticalDirective(OMPCriticalDirective *D) {
}
void ASTStmtWriter::VisitOMPParallelForDirective(OMPParallelForDirective *D) {
- VisitStmt(D);
- Record.push_back(D->getNumClauses());
- Record.push_back(D->getCollapsedNumber());
- VisitOMPExecutableDirective(D);
+ VisitOMPLoopDirective(D);
Code = serialization::STMT_OMP_PARALLEL_FOR_DIRECTIVE;
}
OpenPOWER on IntegriCloud