[index] Include parameter types in the USRs for C functions marked with 'overloadable...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 4 Mar 2016 07:17:48 +0000 (07:17 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 4 Mar 2016 07:17:48 +0000 (07:17 +0000)
llvm-svn: 262694

clang/lib/Index/USRGeneration.cpp
clang/test/Index/Core/index-source.m

index 8547826..cb30090 100644 (file)
@@ -218,7 +218,8 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) {
   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 *
index d57879c..d132662 100644 (file)
@@ -43,3 +43,8 @@ void goo(Base *b) {
 // CHECK-NOT: ObjectType
 -(ObjectType)getit;
 @end
+
+// CHECK: [[@LINE+1]]:6 | function/C | over_func | c:@F@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@over_func#f# | __Z9over_funcf | Decl | rel: 0
+void over_func(float x) __attribute__((overloadable));