robot added a comment.

> so you could replace the logic that prints the return type + arg list with 
> `printType(functype, class, methodname)` (from AST.h). That should pick up 
> noexcept etc.

I've tried it and it's not obvious to me how to do it properly: Since 
`printType` wants to print the _function type_, it will parenthesize the 
placeholder (methodname):

  void (foo)()

I've tried adding a flag to `PrintingPolicy` to avoid parenthesizing the name, 
but I wonder if adjusting a "type printer" to print a function declaration is a 
clean design. Next problem I ran into is parameters: A type printer does not 
need to concern itself with parameter names nor default arguments:

  void foo(int x = 0) = 0;
  void foo(int) override;

Shall I continue to pursue that path? Shall I adjust the type printer to be 
able to print parameter names and default arguments?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153152/new/

https://reviews.llvm.org/D153152

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D153152: Adds twe... Robert Schneider via Phabricator via cfe-commits

Reply via email to