summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-09 07:46:54 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-09 07:46:54 +0000
commit7456ac44b013b3a38deeefb7760e793f0c55f31f (patch)
treee1d6a9236f8cbe986457cf795b1e2b98f4c8051f /clang/lib/Serialization/ASTReaderDecl.cpp
parent487e744f66a11a419e29923ed09cc5f50b650e69 (diff)
downloadbcm5719-llvm-7456ac44b013b3a38deeefb7760e793f0c55f31f.tar.gz
bcm5719-llvm-7456ac44b013b3a38deeefb7760e793f0c55f31f.zip
[PCH] Add some comments, per Ted's request.
llvm-svn: 150162
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index e2f4ae3a9b2..883edba5e31 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -344,6 +344,8 @@ void ASTDeclReader::VisitDecl(Decl *D) {
} else {
DeclContext *SemaDC = ReadDeclAs<DeclContext>(Record, Idx);
DeclContext *LexicalDC = ReadDeclAs<DeclContext>(Record, Idx);
+ // Avoid calling setLexicalDeclContext() directly because it uses
+ // Decl::getASTContext() internally which is unsafe during derialization.
D->setDeclContextsImpl(SemaDC, LexicalDC, Reader.getContext());
}
D->setLocation(Reader.ReadSourceLocation(F, RawLocation));
@@ -351,6 +353,8 @@ void ASTDeclReader::VisitDecl(Decl *D) {
if (Record[Idx++]) { // hasAttrs
AttrVec Attrs;
Reader.ReadAttributes(F, Attrs, Record, Idx);
+ // Avoid calling setAttrs() directly because it uses Decl::getASTContext()
+ // internally which is unsafe during derialization.
D->setAttrsImpl(Attrs, Reader.getContext());
}
D->setImplicit(Record[Idx++]);
OpenPOWER on IntegriCloud