diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-24 16:28:06 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-24 16:28:06 +0000 |
commit | 58a2cd8c0d52e710cbcc57a67eac7b51b0b831c4 (patch) | |
tree | 5a90a0576e259fe137f4af70496cc2cc0e980958 /lib/Serialization/ASTWriter.cpp | |
parent | 024e1c400ec1d23dd76659395f87272da59a2cbd (diff) |
Synthesizing the definition of an implicit member is an AST modification, so notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index fb193651b8..42393dea2b 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -3955,4 +3955,13 @@ void ASTWriter::AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD, AddDeclRef(D, Record); } +void ASTWriter::CompletedImplicitDefinition(const FunctionDecl *D) { + if (D->getPCHLevel() == 0) + return; // Declaration not imported from PCH. + + // Implicit decl from a PCH was defined. + // FIXME: Should implicit definition be a separate FunctionDecl? + RewriteDecl(D); +} + ASTSerializationListener::~ASTSerializationListener() { } |