authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-07 10:05:29+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2019-11-07 10:30:56+02:00
log7a2433419924af05e5e860031ff8279577fb25d5
tree4818b036a3278eabfa9fc2a6bc1a7d8c2e4c4e66
parentc6076a136099c9a87aa1fee1b797b8c944198c5c
signaturelock-open Commit is signed but in an unrecognized format.

self hosted compiler: small fixes to imports and declarations


5 files changed, 12 insertions(+), 11 deletions(-)

src-self-hosted/c_int.zig+5-5
......@@ -68,11 +68,11 @@ pub const CInt = struct {
6868 },
6969 };
7070
71 pub fn sizeInBits(id: Id, self: Target) u32 {
71 pub fn sizeInBits(cint: CInt, self: Target) u32 {
7272 const arch = self.getArch();
7373 switch (self.getOs()) {
7474 .freestanding => switch (self.getArch()) {
75 .msp430 => switch (id) {
75 .msp430 => switch (cint.id) {
7676 .Short,
7777 .UShort,
7878 .Int,
......@@ -85,7 +85,7 @@ pub const CInt = struct {
8585 .ULongLong,
8686 => return 64,
8787 },
88 else => switch (id) {
88 else => switch (cint.id) {
8989 .Short,
9090 .UShort,
9191 => return 16,
......@@ -106,7 +106,7 @@ pub const CInt = struct {
106106 .freebsd,
107107 .openbsd,
108108 .zen,
109 => switch (id) {
109 => switch (cint.id) {
110110 .Short,
111111 .UShort,
112112 => return 16,
......@@ -121,7 +121,7 @@ pub const CInt = struct {
121121 => return 64,
122122 },
123123
124 .windows, .uefi => switch (id) {
124 .windows, .uefi => switch (cint.id) {
125125 .Short,
126126 .UShort,
127127 => return 16,
src-self-hosted/libc_installation.zig+2-2
......@@ -2,7 +2,7 @@ const std = @import("std");
22const builtin = @import("builtin");
33const event = std.event;
44const target = @import("target.zig");
5const Target = target.Target;
5const Target = std.Target;
66const c = @import("c.zig");
77const fs = std.fs;
88const Allocator = std.mem.Allocator;
......@@ -322,7 +322,7 @@ pub const LibCInstallation = struct {
322322 },
323323 };
324324 var group = event.Group(FindError!void).init(allocator);
325 errdefer group.deinit();
325 errdefer group.wait() catch {};
326326 for (dyn_tests) |*dyn_test| {
327327 try group.call(testNativeDynamicLinker, self, allocator, dyn_test);
328328 }
src-self-hosted/llvm.zig+1-1
......@@ -309,7 +309,7 @@ pub fn initializeAllTargets() void {
309309 InitializeAllAsmParsers();
310310}
311311
312pub fn getTriple(allocator: *std.mem.Allocator, self: Target) !std.Buffer {
312pub fn getTriple(allocator: *std.mem.Allocator, self: std.Target) !std.Buffer {
313313 var result = try std.Buffer.initSize(allocator, 0);
314314 errdefer result.deinit();
315315
src-self-hosted/target.zig+2-1
......@@ -1,3 +1,4 @@
1const Target = @import("std").Target;
12// const builtin = @import("builtin");
23
34pub const FloatAbi = enum {
......@@ -55,7 +56,7 @@ pub fn getDynamicLinkerPath(self: Target) ?[]const u8 {
5556 .linux => {
5657 switch (env) {
5758 .android => {
58 if (is64bit(self)) {
59 if (self.getArchPtrBitWidth() == 64) {
5960 return "/system/bin/linker64";
6061 } else {
6162 return "/system/bin/linker";
src-self-hosted/type.zig+2-2
......@@ -294,7 +294,7 @@ pub const Type = struct {
294294 if (self.alignment) |self_align| {
295295 if (self_align != other.alignment.?) return false;
296296 }
297 if (self.data != other.data) return false;
297 if (@TagType(Data)(self.data) != @TagType(Data)(other.data)) return false;
298298 switch (self.data) {
299299 .Generic => |*self_generic| {
300300 const other_generic = &other.data.Generic;
......@@ -341,7 +341,7 @@ pub const Type = struct {
341341 }
342342 };
343343
344 const CallingConvention = builtin.CallingConvention;
344 const CallingConvention = builtin.TypeInfo.CallingConvention;
345345
346346 pub const Param = struct {
347347 is_noalias: bool,