diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-07 00:04:49 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-07 00:04:49 +0000 |
commit | f19e12794d2aa246a15bbd4879a8c7430e884cae (patch) | |
tree | 5895ced0aec011e2be90c5f9f5505a36ee9f8eca /clang/lib/Serialization/ASTCommon.cpp | |
parent | 910db5c5203fcb594b8b72c79f998aeacb7a95d4 (diff) | |
download | bcm5719-llvm-f19e12794d2aa246a15bbd4879a8c7430e884cae.tar.gz bcm5719-llvm-f19e12794d2aa246a15bbd4879a8c7430e884cae.zip |
Replace Sema's map of locally-scoped extern "C" declarations with a DeclContext
of extern "C" declarations. This is simpler and vastly more efficient for
modules builds (we no longer need to load *all* extern "C" declarations to
determine if we have a redeclaration).
No functionality change intended.
llvm-svn: 231538
Diffstat (limited to 'clang/lib/Serialization/ASTCommon.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTCommon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp index 04425acb4c5..85c574c2021 100644 --- a/clang/lib/Serialization/ASTCommon.cpp +++ b/clang/lib/Serialization/ASTCommon.cpp @@ -94,6 +94,7 @@ serialization::getDefinitiveDeclContext(const DeclContext *DC) { switch (DC->getDeclKind()) { // These entities may have multiple definitions. case Decl::TranslationUnit: + case Decl::ExternCContext: case Decl::Namespace: case Decl::LinkageSpec: return nullptr; @@ -149,7 +150,11 @@ serialization::getDefinitiveDeclContext(const DeclContext *DC) { bool serialization::isRedeclarableDeclKind(unsigned Kind) { switch (static_cast<Decl::Kind>(Kind)) { - case Decl::TranslationUnit: // Special case of a "merged" declaration. + case Decl::TranslationUnit: + case Decl::ExternCContext: + // Special case of a "merged" declaration. + return true; + case Decl::Namespace: case Decl::NamespaceAlias: case Decl::Typedef: |