update analysis of builtin functions

This commit is contained in:
Techarix 2023-06-23 21:50:04 +02:00 committed by Lee Cannon
parent ecb18949df
commit 0e57f694be

View File

@ -989,16 +989,22 @@ fn resolveTypeOfNodeUncached(analyser: *Analyser, node_handle: NodeWithHandle) e
const cast_map = std.ComptimeStringMap(void, .{ const cast_map = std.ComptimeStringMap(void, .{
.{"@as"}, .{"@as"},
.{"@atomicLoad"},
.{"@atomicRmw"},
.{"@atomicStore"},
.{"@bitCast"}, .{"@bitCast"},
.{"@fieldParentPtr"}, .{"@mulAdd"},
.{"@errSetCast"},
.{"@fieldParentPtr"}, // the return type is actually a pointer
.{"@floatCast"}, .{"@floatCast"},
.{"@floatToInt"}, .{"@intFromFloat"},
.{"@intCast"}, .{"@intCast"},
.{"@intToEnum"}, .{"@enumFromInt"},
.{"@intToFloat"}, .{"@floatFromInt"},
.{"@intToPtr"}, .{"@ptrFromInt"},
.{"@truncate"},
.{"@ptrCast"}, .{"@ptrCast"},
.{"@truncate"},
.{"@unionInit"},
}); });
if (cast_map.has(call_name)) { if (cast_map.has(call_name)) {
if (params.len < 1) return null; if (params.len < 1) return null;