aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
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
2016-12-28IR: pass genericFnWithImplicitCast testAndrew Kelley
2016-12-28IR: pass passSliceOfEmptyStructToFn testAndrew Kelley
2016-12-26IR: pass intToEnum testAndrew Kelley
2016-12-26IR: pass intToPtrCast testAndrew Kelley
2016-12-26IR: pass staticEvalListInit testAndrew Kelley
2016-12-26IR: pass enumToInt testAndrew Kelley
2016-12-25IR: support compile time global pointer reinterpretAndrew Kelley
this required moving the place we store types to ConstExprValue
2016-12-22IR: fix missing implicit casts in init expressionsAndrew Kelley
and implement runtime struct init instruction
2016-12-22pass void parameters testAndrew Kelley
2016-12-21IR: implement runtime enum init and switch on enum with variableAndrew Kelley
2016-12-20IR: enum init supportAndrew Kelley