stage2: astgen catch
This commit is contained in:
@@ -2570,7 +2570,17 @@ pub fn analyzeIsNull(
|
||||
operand: *Inst,
|
||||
invert_logic: bool,
|
||||
) InnerError!*Inst {
|
||||
return self.fail(scope, src, "TODO implement analysis of isnull and isnotnull", .{});
|
||||
if (operand.value()) |opt_val| {
|
||||
const is_null = opt_val.isNull();
|
||||
return self.constBool(scope, src, invert_logic);
|
||||
}
|
||||
const b = try self.requireRuntimeBlock(scope, src);
|
||||
const inst_tag: Inst.Tag = if (invert_logic) .isnonnull else .isnull;
|
||||
return self.addUnOp(b, src, Type.initTag(.bool), inst_tag, operand);
|
||||
}
|
||||
|
||||
pub fn analyzeIsErr(self: *Module, scope: *Scope, src: usize, operand: *Inst) InnerError!*Inst {
|
||||
return self.fail(scope, src, "TODO implement analysis of iserr", .{});
|
||||
}
|
||||
|
||||
/// Asserts that lhs and rhs types are both numeric.
|
||||
|
||||
Reference in New Issue
Block a user