[cfe-commits] r107871 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/Frontend/PCHReaderDecl.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Jul 8 06:09:41 PDT 2010
Author: akirtzidis
Date: Thu Jul 8 08:09:41 2010
New Revision: 107871
URL: http://llvm.org/viewvc/llvm-project?rev=107871&view=rev
Log:
Fix reading of UsingDecl from PCH.
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=107871&r1=107870&r2=107871&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Thu Jul 8 08:09:41 2010
@@ -2082,6 +2082,9 @@
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classof(const UsingDecl *D) { return true; }
static bool classofKind(Kind K) { return K == Using; }
+
+ friend class PCHDeclReader;
+ friend class PCHDeclWriter;
};
/// UnresolvedUsingValueDecl - Represents a dependent using
Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=107871&r1=107870&r2=107871&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Thu Jul 8 08:09:41 2010
@@ -609,7 +609,9 @@
// would avoid existence checks.
unsigned NumShadows = Record[Idx++];
for(unsigned I = 0; I != NumShadows; ++I) {
- D->addShadowDecl(cast<UsingShadowDecl>(Reader.GetDecl(Record[Idx++])));
+ // Avoid invariant checking of UsingDecl::addShadowDecl, the decl may still
+ // be initializing.
+ D->Shadows.insert(cast<UsingShadowDecl>(Reader.GetDecl(Record[Idx++])));
}
D->setTypeName(Record[Idx++]);
NamedDecl *Pattern = cast_or_null<NamedDecl>(Reader.GetDecl(Record[Idx++]));
More information about the cfe-commits
mailing list