diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-24 17:26:36 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-24 17:26:36 +0000 |
commit | 7b90340c9c7d07aef4e301e72b5e8a30d5f4f0c8 (patch) | |
tree | 534ddbf567967924e8defe105d20f1d749813927 /lib/Serialization/GeneratePCH.cpp | |
parent | 134db1fff5653c164ef41c898943521c49f6ebab (diff) |
Put the mechanism in place to track modifications in an AST entity that were committed after
its initial creation/deserialization and store the changes in a chained PCH.
The idea is that the AST entities call methods on the ASTMutationListener to give notifications
of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes
of the updated entity. WIP
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GeneratePCH.cpp')
-rw-r--r-- | lib/Serialization/GeneratePCH.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp index 5329b6cbd4..0d8ec736b6 100644 --- a/lib/Serialization/GeneratePCH.cpp +++ b/lib/Serialization/GeneratePCH.cpp @@ -30,7 +30,7 @@ PCHGenerator::PCHGenerator(const Preprocessor &PP, const char *isysroot, llvm::raw_ostream *OS) : PP(PP), isysroot(isysroot), Out(OS), SemaPtr(0), - StatCalls(0), Stream(Buffer), Writer(Stream) { + StatCalls(0), Stream(Buffer), Writer(Stream), Chaining(Chaining) { // Install a stat() listener to keep track of all of the stat() // calls. @@ -59,6 +59,12 @@ void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) { Buffer.clear(); } +ASTMutationListener *PCHGenerator::GetASTMutationListener() { + if (Chaining) + return &Writer; + return 0; +} + ASTDeserializationListener *PCHGenerator::GetASTDeserializationListener() { return &Writer; } |