Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIR] [CIRGen] Handle CIR Gen for array of unions
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.
- Loading branch information