-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinstate #1007 equality of array types #1178
Comments
cc @ChuanqiXu9 |
Some detailed description: In #1166, we disabled to check for the equality of array element types for the following issue: In an array of unions (or types containing unions), we may construct an array attribute from the initializers. However, the type of the initializers may be different for unions. #1007 is another try to solve the problem but it shows it is not easy to fix it fundamentally without introducing two type systems: one for code gen for CIR and one for lowering CIR. See the comments in #1160 (comment) for detailed analysis. |
Close llvm#1185 The patch itself seems slightly ad-hoc. As the issue tracked by llvm#1178, the fundamental solution may be to introduce two type systems to solve the inconsistent semantics for Union between LLVM IR and CIR. This will be great to handle other inconsistent semantics between LLVM IR and CIR if any. Back to the patch itself, although the code looks not good initially to me too. But I feel it may be a good workaround since clang/test/CIR/Lowering/union-array.c is an example for array of unions directly and clang/test/CIR/Lowering/nested-union-array.c gives an example for array of unions indirectly (array of structs which contain unions). So I feel we've already covered all the cases. And generally it should be good to use some simple and solid workaround before we introduce the formal full solution.
Originally posted by @bcardosolopes in #1166 (comment)
The text was updated successfully, but these errors were encountered: