summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-12-08 08:48:37 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-12-08 08:48:37 +0000
commit80537a41461de3bec0fa5037a1b35c7e6c2ee07d (patch)
tree3b26051ae3c6eb63a4f0b2dff4fe5677f05cb245 /clang/lib
parentf66cef75757ae3c35ad1ce18c6efe22b82a1903e (diff)
downloadbcm5719-llvm-80537a41461de3bec0fa5037a1b35c7e6c2ee07d.tar.gz
bcm5719-llvm-80537a41461de3bec0fa5037a1b35c7e6c2ee07d.zip
[libclang] Encode location info for anonymous embedded tag decls.
Otherwise the USR will conflict with different embedded tag decls. llvm-svn: 223633
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Index/USRGeneration.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp
index ad092a20ed4..29a1b3dcd12 100644
--- a/clang/lib/Index/USRGeneration.cpp
+++ b/clang/lib/Index/USRGeneration.cpp
@@ -471,9 +471,13 @@ void USRGenerator::VisitTagDecl(const TagDecl *D) {
Buf[off] = 'A';
Out << '@' << *TD;
}
- else
+ else {
+ if (D->isEmbeddedInDeclarator() && !D->isFreeStanding()) {
+ printLoc(Out, D->getLocation(), Context->getSourceManager(), true);
+ } else
Buf[off] = 'a';
}
+ }
// For a class template specialization, mangle the template arguments.
if (const ClassTemplateSpecializationDecl *Spec
OpenPOWER on IntegriCloud