mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 07:32:44 +00:00
compiler-rt: do not depend on usingnamespace
The idea is to depend on this language feature as little as possible with the hopes that it can be adjusted to be less of an anti-pattern. This also helps self-hosted, which does not yet implement `usingnamespace`, get closer to being able to build compiler-rt.
This commit is contained in:
parent
6eecc4af99
commit
fc55814faa
@ -595,9 +595,9 @@ comptime {
|
||||
@export(__muloti4, .{ .name = "__muloti4", .linkage = linkage });
|
||||
const __mulodi4 = @import("compiler_rt/mulodi4.zig").__mulodi4;
|
||||
@export(__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
|
||||
}
|
||||
|
||||
pub usingnamespace @import("compiler_rt/atomics.zig");
|
||||
_ = @import("compiler_rt/atomics.zig");
|
||||
}
|
||||
|
||||
// Avoid dragging in the runtime safety mechanisms into this .o file,
|
||||
// unless we're trying to test this file.
|
||||
|
@ -171,7 +171,10 @@ pub const Feature = enum {
|
||||
zcz_gp,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
@setEvalBranchQuota(2000);
|
||||
|
@ -120,7 +120,10 @@ pub const Feature = enum {
|
||||
xnack_support,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -179,7 +179,10 @@ pub const Feature = enum {
|
||||
zcz,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
@setEvalBranchQuota(10000);
|
||||
|
@ -41,7 +41,10 @@ pub const Feature = enum {
|
||||
xmegau,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -10,7 +10,10 @@ pub const Feature = enum {
|
||||
dwarfris,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -38,7 +38,10 @@ pub const Feature = enum {
|
||||
zreg,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -59,7 +59,10 @@ pub const Feature = enum {
|
||||
xgot,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -11,7 +11,10 @@ pub const Feature = enum {
|
||||
hwmultf5,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -35,7 +35,10 @@ pub const Feature = enum {
|
||||
sm_80,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -72,7 +72,10 @@ pub const Feature = enum {
|
||||
vsx,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -64,7 +64,10 @@ pub const Feature = enum {
|
||||
save_restore,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -26,7 +26,10 @@ pub const Feature = enum {
|
||||
vis3,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -294,7 +294,10 @@ pub const Feature = enum {
|
||||
LongConstantCompositeINTEL,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
@setEvalBranchQuota(2000);
|
||||
|
@ -43,7 +43,10 @@ pub const Feature = enum {
|
||||
vector_packed_decimal_enhancement,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -8,7 +8,10 @@ pub const Feature = enum {
|
||||
vpu,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -18,7 +18,10 @@ pub const Feature = enum {
|
||||
unimplemented_simd128,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
|
@ -147,7 +147,10 @@ pub const Feature = enum {
|
||||
xsaves,
|
||||
};
|
||||
|
||||
pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
|
||||
pub const all_features = blk: {
|
||||
const len = @typeInfo(Feature).Enum.fields.len;
|
||||
@ -2240,8 +2243,8 @@ pub const cpu = struct {
|
||||
.features = featureSet(&[_]Feature{
|
||||
.cx8,
|
||||
.slow_unaligned_mem_16,
|
||||
.vzeroupper,
|
||||
.soft_float,
|
||||
.vzeroupper,
|
||||
}),
|
||||
};
|
||||
pub const nehalem = CpuModel{
|
||||
|
@ -1066,7 +1066,10 @@ fn processOneTarget(job: Job) anyerror!void {
|
||||
try w.writeAll(
|
||||
\\};
|
||||
\\
|
||||
\\pub usingnamespace CpuFeature.feature_set_fns(Feature);
|
||||
\\pub const featureSet = CpuFeature.feature_set_fns(Feature).featureSet;
|
||||
\\pub const featureSetHas = CpuFeature.feature_set_fns(Feature).featureSetHas;
|
||||
\\pub const featureSetHasAny = CpuFeature.feature_set_fns(Feature).featureSetHasAny;
|
||||
\\pub const featureSetHasAll = CpuFeature.feature_set_fns(Feature).featureSetHasAll;
|
||||
\\
|
||||
\\pub const all_features = blk: {
|
||||
\\
|
||||
|
Loading…
Reference in New Issue
Block a user