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
This commit is contained in:
Douglas Gregor 2012-01-14 15:30:55 +00:00
parent 68444de354
commit 463c8e7070
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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);