summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2019-12-14 03:17:03 -0500
committerJohn McCall <rjmccall@apple.com>2019-12-14 03:28:23 -0500
commit2ac702aaf09174432905a9f05b31418a89019437 (patch)
treef8637e77b426c7f04fae4839f50ba1fb2ec6d2cf /clang/lib/Serialization/ASTWriter.cpp
parentc2f18315ff53006e44afe065368019e41cb98053 (diff)
downloadbcm5719-llvm-2ac702aaf09174432905a9f05b31418a89019437.tar.gz
bcm5719-llvm-2ac702aaf09174432905a9f05b31418a89019437.zip
Move ASTRecordWriter into its own header; NFC.
Similar motivations to the movement of ASTRecordReader: AbstractBasicWriter.h already has quite a few dependencies, and it's going to get pretty large as we generate more and more into it. Meanwhile, most clients don't depend on this detail of the implementation and shouldn't need to be recompiled. I've also made OMPClauseWriter private, like it belongs.
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 8c39309d263..a8ea8563a1d 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/Serialization/ASTWriter.h"
+#include "clang/Serialization/ASTRecordWriter.h"
#include "ASTCommon.h"
#include "ASTReaderInternals.h"
#include "MultiOnDiskHashTable.h"
@@ -6004,6 +6004,26 @@ void ASTWriter::AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD,
//// OMPClause Serialization
////===----------------------------------------------------------------------===//
+namespace {
+
+class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
+ ASTRecordWriter &Record;
+
+public:
+ OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {}
+#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S);
+#include "clang/Basic/OpenMPKinds.def"
+ void writeClause(OMPClause *C);
+ void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
+ void VisitOMPClauseWithPostUpdate(OMPClauseWithPostUpdate *C);
+};
+
+}
+
+void ASTRecordWriter::writeOMPClause(OMPClause *C) {
+ OMPClauseWriter(*this).writeClause(C);
+}
+
void OMPClauseWriter::writeClause(OMPClause *C) {
Record.push_back(C->getClauseKind());
Visit(C);
OpenPOWER on IntegriCloud