summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:28:06 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2011-04-24 16:28:06 +0000
commitab238a7d1895201ad3d10fc961ca68105b3844fb (patch)
tree35f13e5311908fff8776d51f1aef650b2d7c87e9 /clang/lib/Serialization/ASTWriter.cpp
parentf830df4e9d1aa0c6971de46d0b8c899788443cb9 (diff)
downloadbcm5719-llvm-ab238a7d1895201ad3d10fc961ca68105b3844fb.tar.gz
bcm5719-llvm-ab238a7d1895201ad3d10fc961ca68105b3844fb.zip
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.
llvm-svn: 130103
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index fb193651b87..42393dea2bc 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/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() { }
OpenPOWER on IntegriCloud