aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-14 15:30:55 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-14 15:30:55 +0000
commit8a8950b13e4d438f732d24f22f63ebe1a9e0075e (patch)
tree4107591475b49180bb5d448eb56fb5d9d2cf91c9 /lib
parent7c99bb5c4901c39460818ff8c00840218c48251f (diff)
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/DeclTemplate.cpp6
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp4
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/AST/DeclTemplate.cpp b/lib/AST/DeclTemplate.cpp
index a745526219..7a15a1c1c7 100644
--- a/lib/AST/DeclTemplate.cpp
+++ b/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/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp
index 32432c0a4f..bf2200d7aa 100644
--- a/lib/Serialization/ASTWriterDecl.cpp
+++ b/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);