diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-28 01:33:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-28 01:33:39 +0000 |
commit | d08aeb6b57ad30fcc973a1d37f9d08d428b59baa (patch) | |
tree | 89637b9f6f329d24f8aca2d579fcd380d8513602 /clang/lib/Serialization/ASTCommon.cpp | |
parent | 9fc9bf83a8a51693585cb9f20d73ffd4baa92203 (diff) | |
download | bcm5719-llvm-d08aeb6b57ad30fcc973a1d37f9d08d428b59baa.tar.gz bcm5719-llvm-d08aeb6b57ad30fcc973a1d37f9d08d428b59baa.zip |
[modules] Number anonymous declarations that are lexically within mergeable
contexts, so that we can merge them when we merge the surrounding context.
llvm-svn: 216639
Diffstat (limited to 'clang/lib/Serialization/ASTCommon.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTCommon.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp index ad046ffa277..ba20f281ea7 100644 --- a/clang/lib/Serialization/ASTCommon.cpp +++ b/clang/lib/Serialization/ASTCommon.cpp @@ -12,6 +12,7 @@ //===----------------------------------------------------------------------===// #include "ASTCommon.h" +#include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Serialization/ASTDeserializationListener.h" @@ -216,3 +217,10 @@ bool serialization::isRedeclarableDeclKind(unsigned Kind) { llvm_unreachable("Unhandled declaration kind"); } + +bool serialization::needsAnonymousDeclarationNumber(const NamedDecl *D) { + if (D->getDeclName() || !isa<CXXRecordDecl>(D->getLexicalDeclContext())) + return false; + return isa<TagDecl>(D) || isa<FieldDecl>(D); +} + |