diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-08-30 12:43:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-08-30 12:50:15 -0700 |
| commit | 7377dce368090e3c49a15d8996cc812adadd3d43 (patch) | |
| tree | 6d9714e54fa2223aa6842d8d496d5f3dadd360e8 /lib/std/target.zig | |
| parent | 65d37239682b6418b6dd25f07187ae99088e67f0 (diff) | |
| download | zig-7377dce368090e3c49a15d8996cc812adadd3d43.tar.gz zig-7377dce368090e3c49a15d8996cc812adadd3d43.zip | |
avoid exposing supportsTailCall in the standard library
This is problematic because in practice it depends on whether the
compiler backend supports it too, as evidenced by the TODO comment about
LLVM not supporting some architectures that in fact do support tail
calls.
Instead this logic is organized strategically in src/target.zig, part of
the internal compiler source code, and the behavior tests in question
duplicate some logic for deciding whether to proceed with the test.
The proper place to expose this flag is in `@import("builtin")` - the
generated source file - so that third party compilers can advertise
whether they support tail calls.
Diffstat (limited to 'lib/std/target.zig')
| -rw-r--r-- | lib/std/target.zig | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/std/target.zig b/lib/std/target.zig index 7b4a468a61..64f9f97809 100644 --- a/lib/std/target.zig +++ b/lib/std/target.zig @@ -1440,16 +1440,6 @@ pub const Target = struct { return !self.cpu.arch.isWasm(); } - pub fn supportsTailCall(self: Target) bool { - switch (self.cpu.arch) { - .wasm32, .wasm64 => return wasm.featureSetHas(self.cpu.features, .tail_call), - // TODO these might not be true but LLVM doesn't seem to be able to handle them - .mips, .mipsel, .mips64, .mips64el => return false, - .powerpc, .powerpcle, .powerpc64, .powerpc64le => return false, - else => return true, - } - } - pub const FloatAbi = enum { hard, soft, |
