diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 04:09:53 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 04:09:53 +0000 |
commit | 65ebb4ac8a7119a16e5a00b075e5b382fd4e434c (patch) | |
tree | aba5d66b22388b22c9c2f62df8fd03f0ecacfcb1 /clang/lib/Serialization/ASTReaderDecl.cpp | |
parent | e972c3622113feaeaf4c1a7c8a60d193c385cb06 (diff) | |
download | bcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.tar.gz bcm5719-llvm-65ebb4ac8a7119a16e5a00b075e5b382fd4e434c.zip |
[modules] If we reach a definition of a class for which we already have a
non-visible definition, skip the new definition and make the old one visible
instead of trying to parse it again and failing horribly. C++'s ODR allows
us to assume that the two definitions are identical.
llvm-svn: 233250
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 10de9f754de..184e6d7772a 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -3793,10 +3793,24 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile, case UPD_STATIC_LOCAL_NUMBER: Reader.Context.setStaticLocalNumber(cast<VarDecl>(D), Record[Idx++]); break; + case UPD_DECL_MARKED_OPENMP_THREADPRIVATE: D->addAttr(OMPThreadPrivateDeclAttr::CreateImplicit( Reader.Context, ReadSourceRange(Record, Idx))); break; + + case UPD_DECL_EXPORTED: + unsigned SubmoduleID = readSubmoduleID(Record, Idx); + Module *Owner = SubmoduleID ? Reader.getSubmodule(SubmoduleID) : nullptr; + if (Owner && Owner->NameVisibility != Module::AllVisible) { + // If Owner is made visible at some later point, make this declaration + // visible too. + Reader.HiddenNamesMap[Owner].HiddenDecls.push_back(D); + } else { + // The declaration is now visible. + D->Hidden = false; + } + break; } } } |