[PATCH] D56297: [DWARFUnit] Don't assume basic types.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 7 09:33:31 PST 2019


aprantl added a comment.

In D56297#1346801 <https://reviews.llvm.org/D56297#1346801>, @andrewrk wrote:

> In D56297#1345884 <https://reviews.llvm.org/D56297#1345884>, @aprantl wrote:
>
> > Is the problem that it is a SubroutineType, but not a function *pointer*?
> >  Generally, if the Verifier accepts it we ought to not crash, so this seems to be okay, but it might be worth asking whether this is really what you want your frontend to be creating since subroutinetypes don't have a size, etc.
>
>
> I'm the author of the frontend that is generating this code. Thanks for the explanation of the problem. Based on this I tried similar code with clang:




> So it looks like I should modify the frontend to represent this as a DerivedType with a baseType=SubroutineType. Is that right?

Assuming that what your frontend produces is actually a function pointer or reference (and not the function *type*), yes.

> For what it's worth, I would consider this issue resolved if the verifier would reject the code. Although I will note that this assertion is not tripped in 7.0.0 for the same code.

Correct. Any input that the Verifier accepts must be accepted by LLVM. We can fix this by either making the Verifier stricter (usually preferred), or by fixing LLVM.


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

https://reviews.llvm.org/D56297





More information about the llvm-commits mailing list