diff options
| author | Isaac Freund <isaac.freund@coil.com> | 2021-12-07 19:34:44 +0100 |
|---|---|---|
| committer | Isaac Freund <mail@isaacfreund.com> | 2021-12-10 23:09:02 +0100 |
| commit | 175463d75dbde1e8e4c5a55159ab4e9446fd211c (patch) | |
| tree | 523bb9e42429e97c288838ab42ee59e18edbaca0 /src/AstGen.zig | |
| parent | 47c309c34a23bcec9b3d72dade688965893614a4 (diff) | |
| download | zig-175463d75dbde1e8e4c5a55159ab4e9446fd211c.tar.gz zig-175463d75dbde1e8e4c5a55159ab4e9446fd211c.zip | |
AstGen: implement @prefetch() builtin
Diffstat (limited to 'src/AstGen.zig')
| -rw-r--r-- | src/AstGen.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/AstGen.zig b/src/AstGen.zig index 3f9d372157..30efa47f4c 100644 --- a/src/AstGen.zig +++ b/src/AstGen.zig @@ -7226,6 +7226,16 @@ fn builtinCall( }); return rvalue(gz, rl, result, node); }, + .prefetch => { + const ptr = try expr(gz, scope, .none, params[0]); + const options = try comptimeExpr(gz, scope, .{ .ty = .prefetch_options_type }, params[1]); + const result = try gz.addExtendedPayload(.prefetch, Zir.Inst.BinNode{ + .node = gz.nodeIndexToRelative(node), + .lhs = ptr, + .rhs = options, + }); + return rvalue(gz, rl, result, node); + }, } } |
