aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2018-02-08error set casting buildingAndrew Kelley
2018-02-05error sets: fix peer resolution of error unionsAndrew Kelley
2018-02-04add --forbid-libraryAndrew Kelley
to help track down accidentally linking against a library
2018-02-03*WIP* error sets - an inferred error set can end up being the global oneAndrew Kelley
2018-02-02*WIP* error sets - correctly resolve inferred error setsAndrew Kelley
2018-01-31*WIP* error setsAndrew Kelley
2018-01-25rename "debug safety" to "runtime safety"Andrew Kelley
closes #437
2018-01-23fix printf format specifierAndrew Kelley
2018-01-23Add array type handling for gen_hMarc Tiehuis
2018-01-22add new kind of test: generating .h files. and moreAndrew Kelley
* docgen supports obj_err code kind for demonstrating errors without explicit test cases * add documentation for `extern enum`. See #367 * remove coldcc keyword and add @setIsCold. See #661 * add compile errors for non-extern struct, enum, unions in function signatures * add .h file generation for extern struct, enum, unions
2018-01-17fix error return traces pointing to off-by-one source lineAndrew Kelley
See #651
2018-01-15add builtin.have_error_return_tracingAndrew Kelley
2018-01-15clean up error return tracingAndrew Kelley
* error return tracing is disabled in release-fast mode * add @errorReturnTrace * zig build API changes build return type from `void` to `%void` * allow `void`, `noreturn`, and `u8` from main. closes #535
2018-01-14stack traces are a variable number of framesAndrew Kelley
2018-01-14error return traces use a zig-provided function to save binary sizeAndrew Kelley
2018-01-14error return trace pointer prefixes other paramsAndrew Kelley
instead of being last. This increases the chances that it can remain in the same register between calls.
2018-01-12*WIP* proof of concept error return tracesAndrew Kelley
2018-01-11functions which can return errors have secret stack trace paramAndrew Kelley
See #651
2018-01-11the same string literal codegens to the same constantAndrew Kelley
this makes it so that you can send the same string literal as a comptime slice and get the same type
2018-01-06Darwin -> MacOSX, added Zen. See #438Andrea Orru
2017-12-26self-hosted: build against zig_llvm and embedded LLDAndrew Kelley
Now the self-hosted compiler re-uses the same C++ code for interfacing with LLVM as the C++ code. It also links against the same LLD library files.
2017-12-24fix segfault when passing union enum with sub byte...Andrew Kelley
...field to const slice parameter we use a packed struct internally to represent a const array of disparate union values, and needed to update the internal getelementptr instruction to recognize that. closes #664
2017-12-23translate-c: set up debug scope for translated functionsAndrew Kelley
2017-12-22fix endianness of sub-byte integer fields in packed structsAndrew Kelley
closes #307
2017-12-19fix crash when implicitly casting array of len 0 to sliceAndrew Kelley
closes #660
2017-12-19bring back code that uses export and fix testsAndrew Kelley
partial revert of 1fdebc1dc4881a00766f7c2b4b2d8ee6ad6e79b6
2017-12-18wip export rewriteAndrew Kelley
2017-12-08translate-c: more complex logic for translating a C cast in a macroAndrew Kelley
2017-12-06add higher level arg-parsing API + misc. changesAndrew Kelley
* 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.
2017-12-05add implicit cast from enum to unionAndrew Kelley
when the enum is the tag type of the union and is comptime known to be of a void field of the union See #642
2017-12-05translate-c: fix not printing clang errorsAndrew Kelley
2017-12-04fix incorrect LLVM IR for union constant when active field is voidAndrew Kelley
found in the llvm6 branch with llvm assertions on
2017-12-04rename builtin.is_big_endian to builtin.endianAndrew Kelley
See #307
2017-12-03rename @EnumTagType to @TagType. add tests for union-enumsAndrew Kelley
See #618
2017-12-03rework enums and unions and their relationship to each otherAndrew Kelley
* @enumTagName renamed to @tagName and it works on enums and union-enums * Remove the EnumTag type. Now there is only enum and union, and the tag type of a union is always an enum. * unions support specifying the tag enum type, and they support inferring an enum tag type. * Enums no longer support field types but they do support setting the tag values. Likewise union-enums when inferring an enum tag type support setting the tag values. * It is now an error for enums and unions to have 0 fields. * switch statements support union-enums closes #618
2017-12-02ability to set tag values of enumsAndrew Kelley
also remove support for enums with 0 values closes #305
2017-12-01packed structs can have enums with explicit tag typesAndrew Kelley
See #305
2017-11-30ability to specify tag type of enumsAndrew Kelley
see #305
2017-11-24rename "parsec" to "translate-c"Andrew Kelley
2017-11-16fix codegen for union init with runtime valueAndrew Kelley
see #144
2017-11-16debug safety for unionsAndrew Kelley
2017-11-16union secret field is the tag index instead of distinct type indexAndrew Kelley
See #144
2017-11-15unions have a secret field for the typeAndrew Kelley
See #144
2017-11-15basic union supportAndrew Kelley
See #144
2017-11-10fix test failuresAndrew Kelley
put all the codegen for fn prototypes to the same place
2017-11-10fix bug when multiple function definitions existAndrew Kelley
This might be related to #529
2017-11-08fix enum sizes too largeAndrew Kelley
closes #598
2017-11-06add @memberType and @memberName builtin functionsAndrew Kelley
see #383 there is a plan to unify most of the reflection into 2 builtin functions, as outlined in the above issue, but this gives us needed features for now, and we can iterate on the design in future commits
2017-11-04add compile-time reflection for function arg typesAndrew Kelley
See #383
2017-11-03Add emit command-line option (#580)Marc Tiehuis
Add emit command-line option