Skip to content

Conversation

@GinShio
Copy link
Contributor

@GinShio GinShio commented Nov 4, 2025

We may use enumeration class in struct backed type, which makes struct type more semantic. However, we need to force these values ​​to be cast from integers to the target type.

Comment on lines +312 to +315
if ((uint64_t)$0 == 0)
$fields.push_back(::llvm::StructType::get($_context));
else
$fields.push_back(::llvm::IntegerType::get($_context, $0));
$fields.push_back(::llvm::IntegerType::get($_context, (uint64_t)$0));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversions here and above should use getToUnsigned and getFromUnsigned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants