diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-20 15:53:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-20 15:53:59 +0000 |
commit | 162dd0245e7ac66b29abe6ceca0a647d3983436d (patch) | |
tree | 9d790750457857c24f63919e71e40a9317098cbf /clang/lib/Frontend/PCHWriter.cpp | |
parent | 04f2d14d6aab1969f5fff80dac6f4a6cfd18bc5a (diff) | |
download | bcm5719-llvm-162dd0245e7ac66b29abe6ceca0a647d3983436d.tar.gz bcm5719-llvm-162dd0245e7ac66b29abe6ceca0a647d3983436d.zip |
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.
llvm-svn: 69595
Diffstat (limited to 'clang/lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHWriter.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHWriter.cpp b/clang/lib/Frontend/PCHWriter.cpp index 6aea7a53727..afe77aebf8f 100644 --- a/clang/lib/Frontend/PCHWriter.cpp +++ b/clang/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); |