diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-07 22:41:46 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-07 22:41:46 +0000 |
commit | e1c2c2023ee160bd3051682faff04c4f9c5e8ebd (patch) | |
tree | 95e465cec02135139802e06ec86badb167bb05bf /tools | |
parent | 60c4612d70229d1d079deaec62c7c8613070fbff (diff) | |
download | clang-e1c2c2023ee160bd3051682faff04c4f9c5e8ebd.tar.gz |
[libclang] Declarations inside anonymous namespaces have internal linkage so
their USR should contain a location.
This uniques them from other declarations with the same name but in different translation units.
rdar://10546541
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndexUSRs.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/libclang/CIndexUSRs.cpp b/tools/libclang/CIndexUSRs.cpp index 6140032729..b76363e324 100644 --- a/tools/libclang/CIndexUSRs.cpp +++ b/tools/libclang/CIndexUSRs.cpp @@ -151,14 +151,8 @@ bool USRGenerator::EmitDeclName(const NamedDecl *D) { return startSize == endSize; } -static bool InAnonymousNamespace(const Decl *D) { - if (const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(D->getDeclContext())) - return ND->isAnonymousNamespace(); - return false; -} - static inline bool ShouldGenerateLocation(const NamedDecl *D) { - return D->getLinkage() != ExternalLinkage && !InAnonymousNamespace(D); + return D->getLinkage() != ExternalLinkage; } void USRGenerator::VisitDeclContext(DeclContext *DC) { |