-
Notifications
You must be signed in to change notification settings - Fork 131
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
Empty union in initialized with undef values in OG and with zeroinitializer in CIR #1272
Comments
Hi @bcardosolopes, I believe the discrepancy is because of this block (lines 1203 - 1214) in I'm new to ClangIR and was wondering if this was a good issue to start contributing on. |
Yep, assigning this to you! Thanks |
Hi, I've been looking into this and trying out different changes and have been trying to modify this function to handle unions in a different way but it isn't working as expected. Inside the if statement checking if T is zero initializable, I added another check to see if T is a union type but this check is always evaluating to false and I'm not sure why (I'm running on the code in the issue). if (T->isUnionType()) Do you have any idea why this is happening and what I can do to fix it? |
I recommend running the example with clang under a debugger! |
I've ran it using the debugger but I'm not sure how to determine where the issue is. How can I get details about the
|
Many LLVM and Clang types have a |
Thank you! That gave me some more information. It looks like by the time it gets to |
There are some differences from the OG LLVM for unions for C++ code...
The empty union in initialized with
undef
values in OG and withzeroinitializer
in CIR:This is a difference - and soon or later we may want to fix it.
Originally posted by @gitoleg in #1257 (comment)
The text was updated successfully, but these errors were encountered: