This is an archive of the discontinued LLVM Phabricator instance.

[Clang][CodeGen]Beautify dump format, add indent for nested struct and struct members
ClosedPublic

Authored by yihanaa on Mar 29 2022, 10:17 PM.

Details

Summary

Beautify dump format, add indent for nested struct and struct members, also fix test cases in dump-struct-builtin.c
for example:
struct:

struct A {
  int a;
  struct B {
    int b;
    struct C {
      struct D {
        int d;
        union E {
          int x;
          int y;
        } e;
      } d;
      int c;
    } c;
  } b;
};

Before:

struct A {
int a = 0
struct B {
    int b = 0
struct C {
struct D {
            int d = 0
union E {
                int x = 0
                int y = 0
                }
            }
        int c = 0
        }
    }
}

After:

struct A {
    int a = 0
    struct B {
        int b = 0
        struct C {
            struct D {
                int d = 0
                union E {
                    int x = 0
                    int y = 0
                }
            }
            int c = 0
        }
    }
}

Diff Detail

Event Timeline

yihanaa created this revision.Mar 29 2022, 10:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 29 2022, 10:17 PM
yihanaa requested review of this revision.Mar 29 2022, 10:17 PM
erichkeane accepted this revision.Mar 30 2022, 6:28 AM

This seems fine to me. I won't likely have time to commit this for a while, but you should be able to apply for commit-rights now and do it yourself.

This revision is now accepted and ready to land.Mar 30 2022, 6:28 AM

This seems fine to me. I won't likely have time to commit this for a while, but you should be able to apply for commit-rights now and do it yourself.

Sorry for taking so long to reply to you, thank you very much for your review and suggestions, and i have tried to apply for commit access from Chris and am waiting for a reply.😊

This revision was landed with ongoing or failed builds.Mar 30 2022, 4:44 PM
This revision was automatically updated to reflect the committed changes.

Thank you for the reviews @erichkeane. I've applied for commit access and commit in 907d3acefc3bdd6eb83f21589c6473ca7e88b3eb.