[PATCH] D122822: [Clang][CodeGen]Add constant array support for __builtin_dump_sturct

Wang Yihan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 10:32:42 PDT 2022


yihanaa added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2071
+  if (Types.find(Type) == Types.end())
+    return Types[Context.VoidPtrTy];
+  return Types[Type];
----------------
erichkeane wrote:
> yihanaa wrote:
> > erichkeane wrote:
> > > When can we hit this case?  Does this mean that any types we dont understand we are just treating as void ptrs?  
> > The previous version treated it as a void *ptr for unsupported types, such as arrays (before this patch) and __int128. This is the case i saw in an issue. I also think that for unsupported types, we should generate a clearer message saying "This type is temporarily not supported", do you have any good ideas?
> A diagnostic about ''TYPE' not yet supported by __bultin...' probably isn't a bad idea if we have the ability.
I think maybe we can emit an error(or warning? in this way, it may be necessary to handle those unsupported types) diag msg, but that might be worth a separate commit. What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122822



More information about the cfe-commits mailing list