erichkeane added a comment.

If it is ok, I think we should probably change the format of the 'dump' for 
fields.  Using the colon to split up the field from the value is unfortunate, 
may I suggest replacing it with '=' instead?  As well as printing the size 
after a colon.  So for:

  void foo(void) {
    struct Bar {
      unsigned c : 1;
      unsigned : 3;
      unsigned : 0;
      unsigned b;
    };
  
    struct Bar a = {
      .c = 1,
      .b = 2022,
    };
  
    __builtin_dump_struct(&a, &printf);
  }

Output:

  struct Bar {
  unsigned int c : 1 = 1
  unsigned int : 3  = 0
  unsigned int : 0 = 
  unsigned int b = 2022
  }

What do you all think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122248

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to