[clang] [clang][Index] Use canonical function parameter types in USRs (PR #68222)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 4 07:41:26 PDT 2023


================
@@ -265,10 +265,13 @@ void USRGenerator::VisitFunctionDecl(const FunctionDecl *D) {
     Out << '>';
   }
 
+  QualType CanonicalType = D->getType().getCanonicalType();
   // Mangle in type information for the arguments.
-  for (auto *PD : D->parameters()) {
-    Out << '#';
-    VisitType(PD->getType());
+  if (auto *FPT = CanonicalType->getAs<FunctionProtoType>()) {
----------------
mizvekov wrote:

I believe you can const qualify this, otherwise LGTM.

https://github.com/llvm/llvm-project/pull/68222


More information about the cfe-commits mailing list