[PATCH] D122920: [Clang][CodeGen]Fix __builtin_dump_struct missing record type field name

Wang Yihan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 10:03:58 PDT 2022


yihanaa added a comment.

I'll just add that in the recursive call, for record type, it will just print what's between {...}
Eg:

  int printf(const char *, ...);
  
  struct A {
      int x;
  };
  
  struct B {
      struct A a;
      struct C {
        int b;
        union X {
          int i;
          int j;
        } z;
      } bar;
  };
  
  
  int main() {
      struct B x = {0};
      __builtin_dump_struct(&x, &printf);
  }

output:

  struct B {
      struct A a = {
          int x = 0
      }
      struct C bar = {
          int b = 0
          union X z = {
              int i = 0
              int j = 0
          }
      }
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122920



More information about the cfe-commits mailing list