aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2017-02-22bitfields support for array of non-store-aligned packed structsAndrew Kelley
2017-02-16pointers with bit offset contain lengthAndrew Kelley
adds compile error when passing pointer that is byte-aligned at the beginning but not the end to a function expecting a fully byte aligned pointer closes #261
2017-02-16ability to write to bit fieldsAndrew Kelley
See #261
2017-02-16support arithmetic for non byte aligned integer typesAndrew Kelley
see #261
2017-02-16reading from a bit field partially worksAndrew Kelley
See #261 Still need to do: * reading a field that has bit offset 0 but still needs to shift and truncate * writing a field
2017-02-16move int and array types to central tableAndrew Kelley
2017-02-15ability to declare const bitfieldsAndrew Kelley
See #261
2017-02-14add runtime debug safety for dividing integer min value by -1Andrew Kelley
closes #260
2017-02-12slice and array re-work plus some misc. changesAndrew Kelley
* `@truncate` builtin allows casting to the same size integer. It also performs two's complement casting between signed and unsigned integers. * The idiomatic way to convert between bytes and numbers is now `mem.readInt` and `mem.writeInt` instead of an unsafe cast. It works at compile time, is safer, and looks cleaner. * Implicitly casting an array to a slice is allowed only if the slice is const. * Constant pointer values know if their memory is from a compile- time constant value or a compile-time variable. * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T still allowed. * Fix inability to pass a mutable pointer to comptime variable at compile-time to a function and have the function modify the memory pointed to by the pointer. * Add the `comptime T: type` parameter back to mem.eql. Prevents accidentally creating instantiations for arrays.
2017-02-11rework compile-time known pointer valuesAndrew Kelley
See #257
2017-02-09remove the depends_on_compile_var codeAndrew Kelley
cleanup from the decision in commit 8a859afd580f438f549ee69a to remove "unnecessary if statement" error
2017-02-09lots of miscellaneous things all in one big commitAndrew Kelley
* add `@compileLog(...)` builtin function - Helps debug code running at compile time - See #240 * fix crash when there is an error on the start value of a slice * add implicit cast from int and float types to int and float literals if the value is known at compile time * make array concatenation work with slices in addition to arrays and c string literals * fix compile error message for something not having field access * fix crash when `@setDebugSafety()` was called from a function being evaluated at compile-time * fix compile-time evaluation of overflow math builtins. * avoid debug safety panic handler in builtin.o and compiler_rt.o since we use no debug safety in these modules anyway * add compiler_rt functions for division on ARM - Closes #254 * move default panic handler to std.debug so users can call it manually * std.io.printf supports a width in the format specifier
2017-02-07variables, memcpy, and memset all get alignmentAndrew Kelley
See #37
2017-02-06coldcc works betterAndrew Kelley
* Only use Cold Calling Convention on x86 * Add the cold attribute to functions marked with coldcc
2017-02-06improved behavior on debug safety crashAndrew Kelley
* instead of emitting a breakpoint for a debug safety crash, zig calls a panic function which prints an error message and a stack trace and then calls abort. * on freestanding OS, this panic function has a default implementation of a simple infinite loop. * users can override the panic implementation by providing `pub fn panic(message: []const u8) -> unreachable { }` * workaround for LLVM segfaulting when you try to use cold calling convention on ARM. closes #245
2017-02-05fix volatile not respected for loadsAndrew Kelley
2017-02-05all functions are nounwind because zig does not support exceptionsAndrew Kelley
2017-02-05`%=` in inline assembly survives optimizationAndrew Kelley
2017-02-05setGlobalSection and setGlobalAlign work for functionsAndrew Kelley
2017-02-05even external functions which provide definitions get nounwindAndrew Kelley
2017-02-04inline assembly supports `%=` syntaxAndrew Kelley
it outputs a number that is unique to each instance of the asm statement in the entire compilation. useful when creating local labels and referring to them multiple times in a single template that generates multiple assembler instructions
2017-02-04memcpy and memset builtins support volatile pointersAndrew Kelley
See #238
2017-02-04remove volatileStore builtin; add volatile pointersAndrew Kelley
closes #238
2017-02-04ability to set global variable alignment and ...Andrew Kelley
..section in the initialization expression
2017-02-03preserve names of exported variablesAndrew Kelley
2017-02-03add volatileStore() builtin functionAndrew Kelley
See #238 We can revisit how volatile will work later - for now here's a builtin function to do it.
2017-02-03add setGlobalAlign and setGlobalSection builtin functionsAndrew Kelley
closes #241
2017-02-03add ability to set linker scriptAndrew Kelley
2017-02-03typedefs work for binary math operationsAndrew Kelley
2017-02-03exported global variables get emitted as external in LLVMAndrew Kelley
2017-02-02update outdated commentAndrew Kelley
2017-02-02prefix op maybe and error are for types onlyAndrew Kelley
2017-01-31fix crash when passing void to var args functionAndrew Kelley
closes #235
2017-01-24printf var args proof of conceptAndrew Kelley
See #167 Need to troubleshoot when we send 2 slices to printf. It goes into an infinite loop. This commit introduces 4 builtin functions: * `@isInteger` * `@isFloat` * `@canImplictCast` * `@typeName`
2017-01-23basic support for functions with variable length argumentsAndrew Kelley
See #77
2017-01-22remove staticEval builtin in favor of comptime expressionAndrew Kelley
2017-01-22introduce comptime expressionAndrew Kelley
closes #221
2017-01-16get rid of zeroes literalAndrew Kelley
closes #222
2017-01-16fix handling of const values for 2d arraysAndrew Kelley
2017-01-16fix array of enums. also render debug info for const varsAndrew Kelley
2017-01-15fix enum codegen and implement comptime switch var on enumsAndrew Kelley
2017-01-12IR: implement macro for function aliasing function pointerAndrew Kelley
2017-01-10IR: implement error for missing or extra switch prongsAndrew Kelley
2017-01-10partially fix parseh commandAndrew Kelley
2017-01-08pass unnecessary if statement testAndrew Kelley
2017-01-05fix mul and sub overflow ops being rendered as additionAndrew Kelley
2016-12-31IR: std library passes codegenAndrew Kelley
2016-12-31IR: add error for goto jumping over variable declarationAndrew Kelley
2016-12-30IR: better basic block dependency detectionAndrew Kelley
2016-12-28IR: error for returning from defer expressionAndrew Kelley
also fix peer type resolution for pure error mixed with error union