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

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 31 10:35:56 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:2071
+  if (Types.find(Type) == Types.end())
+    return Types[Context.VoidPtrTy];
+  return Types[Type];
----------------
yihanaa wrote:
> 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?
As long as we are good about 'notes' to tell the user how we GOT to there, I'd think the warning would be useful.  I'd probably just do something like, "FunnyType Foo = <unsupported>" rather than do something about it.

I'd be OK with that being a separate commit.


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