-
Notifications
You must be signed in to change notification settings - Fork 57
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
emulate chosen compiler in integer literal promotion #722
Conversation
src/aro/Diagnostics/messages.def
Outdated
implicitly_unsigned_literal_gcc | ||
.msg = "integer constant is so large that it is unsigned" | ||
.kind = .warning | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to emulate differently worded diagnostics too.
src/aro/Parser.zig
Outdated
@@ -8448,7 +8448,7 @@ fn fixedSizeInt(p: *Parser, base: u8, buf: []const u8, suffix: NumberSuffix, tok | |||
const max_int = try Value.maxInt(res.ty, p.comp); | |||
if (interned_val.compare(.lte, max_int, p.comp)) break; | |||
} else { | |||
res.ty = .{ .specifier = .ulong_long }; | |||
res.ty = .{ .specifier = if (p.comp.langopts.emulate == .gcc) .int128 else .ulong_long }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to check that the target supports __int128
with target_utils.hasFloat128
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasFloat128??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, target_utils.hasInt128
. It looks like there is a helper for hasFloat128
in Compilation
, you could add the same for hasInt128
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@Vexu could you review changes now if you have a chance? |
Thanks! |
Closes #690