self hosted compiler: small fixes to imports and declarations

master
Vexu 2019-11-07 10:05:29 +02:00
parent c6076a1360
commit 7a24334199
No known key found for this signature in database
GPG Key ID: 5AEABFCAFF5CD8D6
5 changed files with 12 additions and 11 deletions

View File

@ -68,11 +68,11 @@ pub const CInt = struct {
},
};
pub fn sizeInBits(id: Id, self: Target) u32 {
pub fn sizeInBits(cint: CInt, self: Target) u32 {
const arch = self.getArch();
switch (self.getOs()) {
.freestanding => switch (self.getArch()) {
.msp430 => switch (id) {
.msp430 => switch (cint.id) {
.Short,
.UShort,
.Int,
@ -85,7 +85,7 @@ pub const CInt = struct {
.ULongLong,
=> return 64,
},
else => switch (id) {
else => switch (cint.id) {
.Short,
.UShort,
=> return 16,
@ -106,7 +106,7 @@ pub const CInt = struct {
.freebsd,
.openbsd,
.zen,
=> switch (id) {
=> switch (cint.id) {
.Short,
.UShort,
=> return 16,
@ -121,7 +121,7 @@ pub const CInt = struct {
=> return 64,
},
.windows, .uefi => switch (id) {
.windows, .uefi => switch (cint.id) {
.Short,
.UShort,
=> return 16,

View File

@ -2,7 +2,7 @@ const std = @import("std");
const builtin = @import("builtin");
const event = std.event;
const target = @import("target.zig");
const Target = target.Target;
const Target = std.Target;
const c = @import("c.zig");
const fs = std.fs;
const Allocator = std.mem.Allocator;
@ -322,7 +322,7 @@ pub const LibCInstallation = struct {
},
};
var group = event.Group(FindError!void).init(allocator);
errdefer group.deinit();
errdefer group.wait() catch {};
for (dyn_tests) |*dyn_test| {
try group.call(testNativeDynamicLinker, self, allocator, dyn_test);
}

View File

@ -309,7 +309,7 @@ pub fn initializeAllTargets() void {
InitializeAllAsmParsers();
}
pub fn getTriple(allocator: *std.mem.Allocator, self: Target) !std.Buffer {
pub fn getTriple(allocator: *std.mem.Allocator, self: std.Target) !std.Buffer {
var result = try std.Buffer.initSize(allocator, 0);
errdefer result.deinit();

View File

@ -1,3 +1,4 @@
const Target = @import("std").Target;
// const builtin = @import("builtin");
pub const FloatAbi = enum {
@ -55,7 +56,7 @@ pub fn getDynamicLinkerPath(self: Target) ?[]const u8 {
.linux => {
switch (env) {
.android => {
if (is64bit(self)) {
if (self.getArchPtrBitWidth() == 64) {
return "/system/bin/linker64";
} else {
return "/system/bin/linker";

View File

@ -294,7 +294,7 @@ pub const Type = struct {
if (self.alignment) |self_align| {
if (self_align != other.alignment.?) return false;
}
if (self.data != other.data) return false;
if (@TagType(Data)(self.data) != @TagType(Data)(other.data)) return false;
switch (self.data) {
.Generic => |*self_generic| {
const other_generic = &other.data.Generic;
@ -341,7 +341,7 @@ pub const Type = struct {
}
};
const CallingConvention = builtin.CallingConvention;
const CallingConvention = builtin.TypeInfo.CallingConvention;
pub const Param = struct {
is_noalias: bool,