transpile: add support for CTypeKind::UnaryType
s in --translate-const-macros conservative
#1346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sizeof
isn't translated asCTypeKind::Size
#1345.This adds support for
CTypeKind::UnaryType
in--translate-const-macros conservative
. Previously, theseUnaryType
s received the non-portable type ofc_ulong
, which failed to compile since their Rust translations likemem::size_of
returnusize
. On the C side,sizeof
expressions are indeed supposed to have typesize_t
, so they should get the portable typeCTypeKind::Size
. This adds this type infn bubble_expr_types
, which might not be the right place to do so, since that's currently for fixing up the types from clang 15. This type fix could instead be moved to a separate pass as well. In doing so, I also cleaned up some minor stuff infn bubble_expr_types
, which should be easier to review if you ignore whitespace changes.