diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-12-06 18:12:05 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-12-06 18:12:05 -0500 |
| commit | 62c25af8021fc399c9a8c667dd986a458b40a7dd (patch) | |
| tree | be055f4bc246bb05360dac57c02dc3d43b26563f /src/analyze.cpp | |
| parent | 249cb2aa30bbdd0c30f24ef18097e3b1cd3e0da5 (diff) | |
| download | zig-62c25af8021fc399c9a8c667dd986a458b40a7dd.tar.gz zig-62c25af8021fc399c9a8c667dd986a458b40a7dd.zip | |
add higher level arg-parsing API + misc. changes
* add @noInlineCall - see #640
This fixes a crash in --release-safe and --release-fast modes
where the optimizer inlines everything into _start and
clobbers the command line argument data.
If we were able to verify that the user's code never reads
command line args, we could leave off this "no inline"
attribute.
* add i29 and u29 primitive types. u29 is the type of alignment,
so it makes sense to be a primitive.
probably in the future we'll make any `i` or `u` followed by
digits into a primitive.
* add `aligned` functions to Allocator interface
* add `os.argsAlloc` and `os.argsFree` so that you can get
a `[]const []u8`, do whatever arg parsing you want, and then free
it. For now this uses the other API under the hood, but it could
be reimplemented to do a single allocation.
* add tests to make sure command line argument parsing works.
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 61f7bedcbb..431b64f984 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -3818,12 +3818,14 @@ TypeTableEntry **get_int_type_ptr(CodeGen *g, bool is_signed, uint32_t size_in_b index = 6; } else if (size_in_bits == 16) { index = 7; - } else if (size_in_bits == 32) { + } else if (size_in_bits == 29) { index = 8; - } else if (size_in_bits == 64) { + } else if (size_in_bits == 32) { index = 9; - } else if (size_in_bits == 128) { + } else if (size_in_bits == 64) { index = 10; + } else if (size_in_bits == 128) { + index = 11; } else { return nullptr; } |
