aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
AgeCommit message (Collapse)Author
2018-01-07fix struct inside function referencing local constAndrew Kelley
closes #672 the crash and compile errors are fixed but structs inside functions still get named after the functions they're in. this will be fixed later.
2018-01-02ir: new pass iteration strategyAndrew Kelley
Before: * IR basic blocks are in arbitrary order * when doing an IR pass, when a block is encountered, code must look at all the instructions in the old basic block, determine what blocks are referenced, and queue up those old basic blocks first. * This had a bug (See #667) Now: * IR basic blocks are required to be in an order that guarantees they will be referenced by a branch, before any instructions within are referenced. ir pass1 is updated to meet this constraint. * When doing an IR pass, we iterate over old basic blocks in the order they appear. Blocks which have not been referenced are discarded. * After the pass is complete, we must iterate again to look for old basic blocks which now point to incomplete new basic blocks, due to comptime code generation. * This last part can probably be optimized - most of the time we don't need to iterate over the basic block again. closes #667
2017-12-23translate-c: set up debug scope for translated functionsAndrew Kelley
2017-12-22explicitly return from blocksAndrew Kelley
instead of last statement being expression value closes #629
2017-12-20add labeled loops, labeled break, labeled continue. remove gotoAndrew Kelley
closes #346 closes #630 regression: translate-c can no longer translate switch statements. after #629 we can ressurect and modify the code to utilize arbitrarily returning from blocks.
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-19export keyword works againAndrew Kelley
2017-12-19wip bring back export keywordAndrew Kelley
2017-12-18wip export rewriteAndrew Kelley
2017-12-14fix compiler crash in a nullable if after an if in...Andrew Kelley
...a switch prong of a switch with 2 prongs in an else closes #656
2017-12-13fix const and volatile qualifiers being dropped sometimesAndrew Kelley
in the expression `&const a.b`, the const (and/or volatile) qualifiers would be incorrectly dropped. closes #655
2017-12-08add implicit cast from enum tag type of union to const ptr to the unionAndrew Kelley
closes #654
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-05fix regressions from previous commitAndrew Kelley
c49ee9f632dd5ee7f341e9093234f39c19a32115 broke the tests and this fixes them
2017-12-05switch on enum which only has 1 field is comptime knownAndrew Kelley
closes #593
2017-12-05fix enum with 1 member causing segfaultAndrew Kelley
closes #647
2017-12-05allow union and its tag type to peer resolve to the tag typeAndrew Kelley
2017-12-05allow implicit cast from union to its enum tag typeAndrew Kelley
closes #642
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-05fix casting integer literal to enumAndrew Kelley
2017-12-04more tests for unionsAndrew Kelley
See #618
2017-12-04fix abi alignment of union-enums not counting tag typeAndrew Kelley
add more tests for unions See #618
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-02casting between integer and enum only works via tag typeAndrew Kelley
See #305
2017-11-30ability to specify tag type of enumsAndrew Kelley
see #305
2017-11-29fix build broken by previous commitAndrew Kelley
now we report a compile error for unusual failures from translate-c
2017-11-29fix capturing value of switch with all unreachable prongsAndrew Kelley
closes #635
2017-11-27Added support for exporting of C field expressionsdimenus
2017-11-25fix crash when constant inside comptime function has compile errorAndrew Kelley
closes #625
2017-11-25add an assert to catch corrupted memoryAndrew Kelley
2017-11-24fix assertion failed when invalid type encounteredAndrew Kelley
2017-11-24rename "parsec" to "translate-c"Andrew Kelley
2017-11-16union secret field is the tag index instead of distinct type indexAndrew 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-09fix parameter of extern var args not type checkedAndrew Kelley
closes #601
2017-11-07std.io: introduce buffered I/O and change APIAndrew Kelley
I started working on #465 and made some corresponding std.io API changes. New structs: * std.io.FileInStream * std.io.FileOutStream * std.io.BufferedOutStream * std.io.BufferedInStream Removed: * std.io.File.in_stream * std.io.File.out_stream Now instead of &file.out_stream or &file.in_stream to get access to the stream API for a file, you get it like this: var file_in_stream = io.FileInStream.init(&file); const in_stream = &file_in_stream.stream; var file_out_stream = io.FileOutStream.init(&file); const out_stream = &file_out_stream.stream; This is evidence that we might not need any OOP features - See #130.
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-04fix build on MacOSAndrew Kelley
2017-11-04add compile-time reflection for function arg typesAndrew Kelley
See #383
2017-11-03more compile-time type reflectionAndrew Kelley
See #383
2017-10-25cleaner verbose flags and zig build prints failed commandAndrew Kelley
2017-10-23add maximum value for @setAlignStackAndrew Kelley
2017-10-21report compile error instead of crashing for void in var argsAndrew Kelley
See #557
2017-10-06fix compiler crash when invalid value usedAndrew Kelley
closes #527
2017-10-03add @setAlignStack builtinAndrew Kelley