aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
diff options
context:
space:
mode:
authorValentin Anger <syrupthinker@gryphno.de>2020-01-29 13:22:11 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-01-29 16:09:07 -0500
commitd448c3d38af9f8f70daaa2817a5834e30da4b8ca (patch)
tree647e1885ea02bbe9557338d0edb818f17abaae21 /lib/std/builtin.zig
parent59bc1d272120bd860cc3cd1f894a2a4e08fc1f3f (diff)
downloadzig-d448c3d38af9f8f70daaa2817a5834e30da4b8ca.tar.gz
zig-d448c3d38af9f8f70daaa2817a5834e30da4b8ca.zip
Add support for code model selection
Diffstat (limited to 'lib/std/builtin.zig')
-rw-r--r--lib/std/builtin.zig15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index d65b9b08ee..d8f24753d3 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -91,6 +91,21 @@ pub const AtomicRmwOp = enum {
Min,
};
+/// The code model puts constraints on the location of symbols and the size of code and data.
+/// The selection of a code model is a trade off on speed and restrictions that needs to be selected on a per application basis to meet its requirements.
+/// A slightly more detailed explanation can be found in (for example) the [System V Application Binary Interface (x86_64)](https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf) 3.5.1.
+///
+/// This data structure is used by the Zig language code generation and
+/// therefore must be kept in sync with the compiler implementation.
+pub const CodeModel = enum {
+ default,
+ tiny,
+ small,
+ kernel,
+ medium,
+ large,
+};
+
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
pub const Mode = enum {