[PATCH] D132900: [DWARF] Fix infinite recursion in Type Printer.

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 12:22:53 PDT 2022


dblaikie added a comment.

In D132900#3780904 <https://reviews.llvm.org/D132900#3780904>, @dblaikie wrote:

> Reduced down to:
>
>   struct t1;
>   
>   void f1() {
>     using t2 = t1;
>     void (t2::* __fn)();
>   }
>
> Still investigating.

Ah, so the critical difference between GCC and Clang's DWARF on this is that GCC creates the pointer type (when it's pointer-to-local-typedef) inside the subroutine_type (it's probably trying to create it inside the function, since the pointer type, while not strictly scoped, would only be usable inside the function type anyway) - this creates the infinite recursion when trying to print the scope of the pointer type (really a pointer type is unscoped, since it's unnamed - maybe we could fix it so we don't print out any scope info for unnameable types (anonymous structs/classes/etc are still logically scoped even though they don't have a name, for instance - but pointer types never really have a scope/name, just a representation))


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132900



More information about the llvm-commits mailing list