[llvm] Fix MSVC Demangling with auto NTTP mangled names for function pointer, pointer to data and integral types (PR #96590)

Max Winkler via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 21:34:38 PDT 2024


================
@@ -2266,15 +2296,17 @@ Demangler::demangleTemplateParameterList(std::string_view &MangledName) {
     } else if (consumeFront(MangledName, "$$C")) {
       // Type has qualifiers.
       TP.N = demangleType(MangledName, QualifierMangleMode::Mangle);
-    } else if (llvm::itanium_demangle::starts_with(MangledName, "$1") ||
-               llvm::itanium_demangle::starts_with(MangledName, "$H") ||
-               llvm::itanium_demangle::starts_with(MangledName, "$I") ||
-               llvm::itanium_demangle::starts_with(MangledName, "$J")) {
+    } else if (startsWithOrWithoutPrefix(MangledName, "$1", IsAutoNTTP, 1) ||
----------------
MaxEW707 wrote:

I am not super happy with this fix but it was the cleanest way I could come up with to support `$M` within the current infrastructure with minimal code changes.

Once I fix the rest of the name mangling issues in clang I need to come back here and most likely refactor how we demangle the template parameter list with a larger holistic view of the different mangling schemes MSVC has.

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


More information about the llvm-commits mailing list