diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-14 15:30:55 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-14 15:30:55 +0000 |
commit | 463c8e7070b1146cc4f9fa66774efc1fe3b39775 (patch) | |
tree | a1c80b2c90ab447e3f0456cf8c7d630368a56f9b | |
parent | 68444de354987f9816d368a75997d0f79e359f7b (diff) | |
download | bcm5719-llvm-463c8e7070b1146cc4f9fa66774efc1fe3b39775.tar.gz bcm5719-llvm-463c8e7070b1146cc4f9fa66774efc1fe3b39775.zip |
Add a FIXME for mutation of the common pointer of a RedeclarableTemplateDecl. It is not clear that it's worth delaying the allocation of said pointer
llvm-svn: 148182
-rw-r--r-- | clang/lib/AST/DeclTemplate.cpp | 6 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp index a7455262197..7a15a1c1c79 100644 --- a/clang/lib/AST/DeclTemplate.cpp +++ b/clang/lib/AST/DeclTemplate.cpp @@ -127,8 +127,12 @@ RedeclarableTemplateDecl::CommonBase *RedeclarableTemplateDecl::getCommonPtr() { } // If we never found a common pointer, allocate one now. - if (!Common) + if (!Common) { + // FIXME: If any of the declarations is from an AST file, we probably + // need an update record to add the common data. + Common = newCommon(getASTContext()); + } // Update any previous declarations we saw with the common pointer. for (unsigned I = 0, N = PrevDecls.size(); I != N; ++I) diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 32432c0a4fc..bf2200d7aa2 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -1237,9 +1237,11 @@ void ASTDeclWriter::VisitDeclContext(DeclContext *DC, uint64_t LexicalOffset, template <typename T> void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { + T *First = D->getFirstDeclaration(); + Writer.AddDeclRef(First); + enum { FirstDeclaration = 0, FirstInFile, PointsToPrevious }; T *Prev = D->getPreviousDeclaration(); - T *First = D->getFirstDeclaration(); if (!Prev) { Record.push_back(FirstDeclaration); |