[PATCH] D44093: [BUILTINS] structure pretty printer
Alexander Richardson via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 10 10:48:49 PDT 2018
arichardson accepted this revision.
arichardson added a comment.
> So, for the moment, we are only handling basic types. That said, for the enum in C, we will print according to the type of the enum.
> In the future versions, I really want to be able to print the name of the enum so that the output is more relevent.
> Anyway, the rule I followed for the moment is : if I don't recognize the type, I print it as an address.
I you just print the address for unrecognized types then that should be fine. Thanks
================
Comment at: test/Sema/builtin-dump-struct.c:42
+ __builtin_dump_struct(&a, goodfunc2);
+}
----------------
paulsemel wrote:
> arichardson wrote:
> > I think there should also be a test here that we get an error when the struct contains bitfields instead of crashing/generating nonsense in CodeGen.
> Do you really think that I should throw an error just because there is a bitfield ?
> I was thinking about just accepting the fact that the bitfield outputs are not correct but permit the user to pretty print the remaining part of the structure.
> What do you think ?
I would prefer an error instead of incorrect output since that can result in lots of unncessary debug work/false conclusions. But as long as it gets fixed/turned into an error before the final 7.0 release I think it shouldn't matter.
Repository:
rC Clang
https://reviews.llvm.org/D44093
More information about the cfe-commits
mailing list