aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHWriter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-20 15:53:59 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-20 15:53:59 +0000
commite7785040107266d01ebdcc066365f70b7ace371f (patch)
treefa7201b641213c1415b1e35f710339cce4666bd6 /lib/Frontend/PCHWriter.cpp
parent53c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eec (diff)
Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This will be used by the PCH writer to serialize Sema state. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r--lib/Frontend/PCHWriter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp
index 6aea7a5372..afe77aebf8 100644
--- a/lib/Frontend/PCHWriter.cpp
+++ b/lib/Frontend/PCHWriter.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "clang/Frontend/PCHWriter.h"
+#include "../Sema/Sema.h" // FIXME: move header into include/clang/Sema
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclContextInternals.h"
@@ -1760,7 +1761,10 @@ void PCHWriter::AddString(const std::string &Str, RecordData &Record) {
PCHWriter::PCHWriter(llvm::BitstreamWriter &Stream)
: Stream(Stream), NextTypeID(pch::NUM_PREDEF_TYPE_IDS), NumStatements(0) { }
-void PCHWriter::WritePCH(ASTContext &Context, const Preprocessor &PP) {
+void PCHWriter::WritePCH(Sema &SemaRef) {
+ ASTContext &Context = SemaRef.Context;
+ Preprocessor &PP = SemaRef.PP;
+
// Emit the file header.
Stream.Emit((unsigned)'C', 8);
Stream.Emit((unsigned)'P', 8);