feature. See also
. The project being documented here (as the example) is the Zig library itself.
AstGen.assignShiftSat
fn assignShiftSat(gz: *GenZir, scope: *Scope, infix_node: Ast.Node.Index) InnerError!void
File
Code
fn assignShiftSat(gz: *GenZir, scope: *Scope, infix_node: Ast.Node.Index) InnerError!void {
try emitDbgNode(gz, infix_node);
const astgen = gz.astgen;
const tree = astgen.tree;
const lhs_node, const rhs_node = tree.nodeData(infix_node).node_and_node;
const lhs_ptr = try lvalExpr(gz, scope, lhs_node);
const lhs = try gz.addUnNode(.load, lhs_ptr, infix_node);
const rhs = try expr(gz, scope, .{ .rl = .none }, rhs_node);
const result = try gz.addPlNode(.shl_sat, infix_node, Zir.Inst.Bin{
.lhs = lhs,
.rhs = rhs,
});
_ = try gz.addPlNode(.store_node, infix_node, Zir.Inst.Bin{
.lhs = lhs_ptr,
.rhs = result,
});
}