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 {...@@ -68,11 +68,11 @@ pub const CInt = struct {
68 },68 },
69 };69 };
7070
71 pub fn sizeInBits(id: Id, self: Target) u32 {71 pub fn sizeInBits(cint: CInt, self: Target) u32 {
72 const arch = self.getArch();72 const arch = self.getArch();
73 switch (self.getOs()) {73 switch (self.getOs()) {
74 .freestanding => switch (self.getArch()) {74 .freestanding => switch (self.getArch()) {
75 .msp430 => switch (id) {75 .msp430 => switch (cint.id) {
76 .Short,76 .Short,
77 .UShort,77 .UShort,
78 .Int,78 .Int,
...@@ -85,7 +85,7 @@ pub const CInt = struct {...@@ -85,7 +85,7 @@ pub const CInt = struct {
85 .ULongLong,85 .ULongLong,
86 => return 64,86 => return 64,
87 },87 },
88 else => switch (id) {88 else => switch (cint.id) {
89 .Short,89 .Short,
90 .UShort,90 .UShort,
91 => return 16,91 => return 16,
...@@ -106,7 +106,7 @@ pub const CInt = struct {...@@ -106,7 +106,7 @@ pub const CInt = struct {
106 .freebsd,106 .freebsd,
107 .openbsd,107 .openbsd,
108 .zen,108 .zen,
109 => switch (id) {109 => switch (cint.id) {
110 .Short,110 .Short,
111 .UShort,111 .UShort,
112 => return 16,112 => return 16,
...@@ -121,7 +121,7 @@ pub const CInt = struct {...@@ -121,7 +121,7 @@ pub const CInt = struct {
121 => return 64,121 => return 64,
122 },122 },
123123
124 .windows, .uefi => switch (id) {124 .windows, .uefi => switch (cint.id) {
125 .Short,125 .Short,
126 .UShort,126 .UShort,
127 => return 16,127 => return 16,
src-self-hosted/libc_installation.zig+2-2
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const event = std.event;3const event = std.event;
4const target = @import("target.zig");4const target = @import("target.zig");
5const Target = target.Target;5const Target = std.Target;
6const c = @import("c.zig");6const c = @import("c.zig");
7const fs = std.fs;7const fs = std.fs;
8const Allocator = std.mem.Allocator;8const Allocator = std.mem.Allocator;
...@@ -322,7 +322,7 @@ pub const LibCInstallation = struct {...@@ -322,7 +322,7 @@ pub const LibCInstallation = struct {
322 },322 },
323 };323 };
324 var group = event.Group(FindError!void).init(allocator);324 var group = event.Group(FindError!void).init(allocator);
325 errdefer group.deinit();325 errdefer group.wait() catch {};
326 for (dyn_tests) |*dyn_test| {326 for (dyn_tests) |*dyn_test| {
327 try group.call(testNativeDynamicLinker, self, allocator, dyn_test);327 try group.call(testNativeDynamicLinker, self, allocator, dyn_test);
328 }328 }
src-self-hosted/llvm.zig+1-1
...@@ -309,7 +309,7 @@ pub fn initializeAllTargets() void {...@@ -309,7 +309,7 @@ pub fn initializeAllTargets() void {
309 InitializeAllAsmParsers();309 InitializeAllAsmParsers();
310}310}
311311
312pub fn getTriple(allocator: *std.mem.Allocator, self: Target) !std.Buffer {312pub fn getTriple(allocator: *std.mem.Allocator, self: std.Target) !std.Buffer {
313 var result = try std.Buffer.initSize(allocator, 0);313 var result = try std.Buffer.initSize(allocator, 0);
314 errdefer result.deinit();314 errdefer result.deinit();
315315
src-self-hosted/target.zig+2-1
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1const Target = @import("std").Target;
1// const builtin = @import("builtin");2// const builtin = @import("builtin");
23
3pub const FloatAbi = enum {4pub const FloatAbi = enum {
...@@ -55,7 +56,7 @@ pub fn getDynamicLinkerPath(self: Target) ?[]const u8 {...@@ -55,7 +56,7 @@ pub fn getDynamicLinkerPath(self: Target) ?[]const u8 {
55 .linux => {56 .linux => {
56 switch (env) {57 switch (env) {
57 .android => {58 .android => {
58 if (is64bit(self)) {59 if (self.getArchPtrBitWidth() == 64) {
59 return "/system/bin/linker64";60 return "/system/bin/linker64";
60 } else {61 } else {
61 return "/system/bin/linker";62 return "/system/bin/linker";
src-self-hosted/type.zig+2-2
...@@ -294,7 +294,7 @@ pub const Type = struct {...@@ -294,7 +294,7 @@ pub const Type = struct {
294 if (self.alignment) |self_align| {294 if (self.alignment) |self_align| {
295 if (self_align != other.alignment.?) return false;295 if (self_align != other.alignment.?) return false;
296 }296 }
297 if (self.data != other.data) return false;297 if (@TagType(Data)(self.data) != @TagType(Data)(other.data)) return false;
298 switch (self.data) {298 switch (self.data) {
299 .Generic => |*self_generic| {299 .Generic => |*self_generic| {
300 const other_generic = &other.data.Generic;300 const other_generic = &other.data.Generic;
...@@ -341,7 +341,7 @@ pub const Type = struct {...@@ -341,7 +341,7 @@ pub const Type = struct {
341 }341 }
342 };342 };
343343
344 const CallingConvention = builtin.CallingConvention;344 const CallingConvention = builtin.TypeInfo.CallingConvention;
345345
346 pub const Param = struct {346 pub const Param = struct {
347 is_noalias: bool,347 is_noalias: bool,