]> granicus.if.org Git - clang/commitdiff
[libclang] Encode the template specialization parameters of a function
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 10 Feb 2012 20:10:32 +0000 (20:10 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 10 Feb 2012 20:10:32 +0000 (20:10 +0000)
specialization in its USR string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150264 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndexUSRs.cpp

index 446baa08fa99bf08eeb6c98b8fe4e5a82beda786..f5503942695541af5d19960d86c0ba8f279bb1b2 100644 (file)
@@ -197,6 +197,16 @@ void USRGenerator::VisitFunctionDecl(FunctionDecl *D) {
   if (!Ctx.getLangOptions().CPlusPlus || D->isExternC())
     return;
 
+  if (const TemplateArgumentList *
+        SpecArgs = D->getTemplateSpecializationArgs()) {
+    Out << '<';
+    for (unsigned I = 0, N = SpecArgs->size(); I != N; ++I) {
+      Out << '#';
+      VisitTemplateArgument(SpecArgs->get(I));
+    }
+    Out << '>';
+  }
+
   // Mangle in type information for the arguments.
   for (FunctionDecl::param_iterator I = D->param_begin(), E = D->param_end();
        I != E; ++I) {