Merge remote-tracking branch 'origin/master' into llvm15

This commit is contained in:
Andrew Kelley 2022-08-05 00:33:50 -07:00
commit e1dbb70bef
3 changed files with 8 additions and 8 deletions

View File

@ -2215,6 +2215,7 @@ var zigAnalysis;
}
if (typesList.length !== 0) {
window.x = typesList;
resizeDomList(domListTypes, typesList.length, '<li><a href="#"></a></li>');
for (let i = 0; i < typesList.length; i += 1) {
let liDom = domListTypes.children[i];
@ -2252,7 +2253,6 @@ var zigAnalysis;
if (fnsList.length !== 0) {
resizeDomList(domListFns, fnsList.length, '<div><dt></dt><dd></dd></div>');
window.x = domListFns;
for (let i = 0; i < fnsList.length; i += 1) {
let decl = fnsList[i];
let trDom = domListFns.children[i];
@ -2594,7 +2594,7 @@ var zigAnalysis;
if (list[mainDeclIndex] != null) continue;
let decl = zigAnalysis.decls[mainDeclIndex];
let declVal = decl.value; //resolveValue(decl.value);
let declVal = resolveValue(decl.value);
let declNames = item.declNames.concat([decl.name]);
list[mainDeclIndex] = {
pkgNames: pkgNames,
@ -2615,7 +2615,7 @@ var zigAnalysis;
}
// Generic function
// Generic fun/ction
if (value.kind == typeKinds.Fn && value.generic_ret != null) {
let resolvedVal = resolveValue({ expr: value.generic_ret});
if ("type" in resolvedVal.expr) {

View File

@ -3497,10 +3497,9 @@ fn analyzeFunction(
},
},
else => blk: {
//const last_instr_index = fn_info.ret_ty_body[fn_info.ret_ty_body.len - 1];
//const break_operand = data[last_instr_index].@"break".operand;
//const wr = try self.walkRef(file, scope, break_operand, false);
const wr = try self.walkRef(file, scope, fn_info.ret_ty_ref, false);
const last_instr_index = fn_info.ret_ty_body[fn_info.ret_ty_body.len - 1];
const break_operand = data[last_instr_index].@"break".operand;
const wr = try self.walkRef(file, scope, break_operand, false);
break :blk wr.expr;
},
};

View File

@ -104,7 +104,8 @@ fn testZigInitLib(zig_exe: []const u8, dir_path: []const u8) !void {
fn testZigInitExe(zig_exe: []const u8, dir_path: []const u8) !void {
_ = try exec(dir_path, true, &[_][]const u8{ zig_exe, "init-exe" });
const run_result = try exec(dir_path, true, &[_][]const u8{ zig_exe, "build", "run" });
try testing.expectEqualStrings("info: All your codebase are belong to us.\n", run_result.stderr);
try testing.expectEqualStrings("All your codebase are belong to us.\n", run_result.stderr);
try testing.expectEqualStrings("Run `zig build test` to run the tests.\n", run_result.stdout);
}
fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {