[PATCH] D49639: [MS Demangler] Demangle pointers to member functions

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 25 19:53:57 PDT 2018


zturner added a comment.

In https://reviews.llvm.org/D49639#1171949, @rnk wrote:

> In https://reviews.llvm.org/D49639#1171901, @ruiu wrote:
>
> > Even though `int __cdecl (*)(void) __cdecl (B::*volatile memptrtofun7)(void)` is easier to read, it is not a valid piece of code, no? It is unfortunate that the C type declaration is so hard to read, but I believe people expect that demangler emits function declaration not in some "improved" form but in the regular C grammar.
>
>
> +1


I guess another option would be to print something like:

  T1 (__cdecl B::*volatile memptrtofun7)(void)
  with
  [
      T1 = int (__cdecl *)(void);
  ]

but that would be a little strange as a default since, as you said, usually people just want 1 declaration.  But perhaps it would be an interesting thing to put behind a command line option in case you want a readable declaration rather than a pedantically legal declaration.  It could make some types of symbols significantly easier to read, especially when the same parameter is repeated multiple times. (which should be easy to identify from the mangling).


https://reviews.llvm.org/D49639





More information about the llvm-commits mailing list