r262694 - [index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.
Argyrios Kyrtzidis via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 3 23:17:49 PST 2016
Author: akirtzidis
Date: Fri Mar 4 01:17:48 2016
New Revision: 262694
URL: http://llvm.org/viewvc/llvm-project?rev=262694&view=rev
Log:
[index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.
Modified:
cfe/trunk/lib/Index/USRGeneration.cpp
cfe/trunk/test/Index/Core/index-source.m
Modified: cfe/trunk/lib/Index/USRGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=262694&r1=262693&r2=262694&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Fri Mar 4 01:17:48 2016
@@ -218,7 +218,8 @@ void USRGenerator::VisitFunctionDecl(con
D->getDeclName().print(Out, Policy);
ASTContext &Ctx = *Context;
- if (!Ctx.getLangOpts().CPlusPlus || D->isExternC())
+ if ((!Ctx.getLangOpts().CPlusPlus || D->isExternC()) &&
+ !D->hasAttr<OverloadableAttr>())
return;
if (const TemplateArgumentList *
Modified: cfe/trunk/test/Index/Core/index-source.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.m?rev=262694&r1=262693&r2=262694&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.m (original)
+++ cfe/trunk/test/Index/Core/index-source.m Fri Mar 4 01:17:48 2016
@@ -43,3 +43,8 @@ void goo(Base *b) {
// CHECK-NOT: ObjectType
-(ObjectType)getit;
@end
+
+// CHECK: [[@LINE+1]]:6 | function/C | over_func | c:@F at over_func#I# | __Z9over_funci | Decl | rel: 0
+void over_func(int x) __attribute__((overloadable));
+// CHECK: [[@LINE+1]]:6 | function/C | over_func | c:@F at over_func#f# | __Z9over_funcf | Decl | rel: 0
+void over_func(float x) __attribute__((overloadable));
More information about the cfe-commits
mailing list