aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2019-12-16expose the ability to disable C sanitizationAndrew Kelley
and disable C sanitization when building libcs. Empirically, they seem to trigger undef-sanitization.
2019-12-16use -fsanitize=undefined for C code in safe build modesAndrew Kelley
closes #3569
2019-12-15improve extern enumVexu
2019-12-15Generate the fn pointers into the correct address spaceLemonBoy
Fixes #3645
2019-12-15Make sure the address is aligned for intToPtr opsLemonBoy
Closes #773
2019-12-13Merge pull request #3896 from Vexu/translate-c-2Andrew Kelley
Translate-c self-hosted var decl and remove translate mode
2019-12-13revert removal of translate mode in stage 1Vexu
2019-12-12un-special-case startup code in the std libAndrew Kelley
Previously, the compiler had special logic to determine whether to include the startup code, which was in `std/special/start.zig`. Now, the file is moved to `std/start.zig`, and there is no special logic in the compiler. Instead, the standard library unconditionally imports the `start.zig` file, which then has a `comptime` block that does the logic of determining what, if any, start symbols to export. Instead of `start.zig` being in its own special package, it is just another normal file that is part of the standard library. `std.builtin.TestFn` is now part of the standard library rather than specially generated by the compiler.
2019-12-12remove concept of translate modeVexu
2019-12-10Replace typeOf with TypeOf in stage0Robin Voetter
2019-12-09remove var args from the languageAndrew Kelley
closes #208
2019-12-08tuple detection does not require AST nodeAndrew Kelley
2019-12-06Merge pull request #3856 from ziglang/builtin-callAndrew Kelley
introduce `@call` and remove other builtin calls
2019-12-06remove `@inlineCall` from zigAndrew Kelley
2019-12-05private linkage for unnamed internal constantsAndrew Kelley
2019-12-05remove `@noInlineCall` from zigAndrew Kelley
2019-12-05implement `@call`Andrew Kelley
closes #3732
2019-12-03fix `zig builtin`Andrew Kelley
2019-12-03WinMainCRTStartup implies defaulting to console subsystemAndrew Kelley
2019-12-03activate start code when pub main existsAndrew Kelley
and rename LinkType->LinkMode, OutType->OutputMode
2019-12-03correct caching and add test for missing fn nameVexu
2019-12-03move more startup code to std libVexu
2019-12-02Accept comptime-known expression for asmLemonBoy
2019-12-01inline ConstGlobalRefs into ZigValueAndrew Kelley
Having ConstGlobalRefs be a pointer in ZigValue was a hack that caused plenty of bugs. It was used to work around difficulties in type coercing array values into slices. However, after #3787 is merged, array values no longer type coerce into slices, and so this provided an opportunity to clean up the code. This has the nice effect of reducing stage1 peak RAM usage during the std lib tests from 3.443 GiB to 3.405 GiB (saving 39 MiB). There is one behavior test failing in this branch, which I plan to debug after merging #3787.
2019-11-30Merge pull request #3284 from Sahnvour/export_variablesAndrew Kelley
Improved support for exporting variables
2019-11-25stage1: consolodate interningMichael Dusan
- merge const_void_val → intern.x_void - move const_zero_byte → intern.zero_byte - wrap intern access
2019-11-25const interning for 1-possible-value typesMichael Dusan
2019-11-25unembed ZigValue from IrInstructionMichael Dusan
2019-11-25rename ConstExprValue → ZigValueMichael Dusan
2019-11-24Merge remote-tracking branch 'origin/master' into null-terminated-pointersAndrew Kelley
2019-11-24gen-h: register the need for stdbool.h and stdint.h when exploring types ↵Sahnvour
recursively otherwise they wouldn't be included when only a struct contains them
2019-11-24gen-h: add a pass for exported variablesSahnvour
2019-11-24refactored gen_h_file to improve maintainability and outputSahnvour
- extracted functions - factorised extern "C" into a block containing all function prototypes instead of writing macros all over the place - using intermediate buffers instead of writing directly to the output file
2019-11-24all tests passingAndrew Kelley
2019-11-23update the stage1 implementation to the new proposalAndrew Kelley
See #3731
2019-11-21improve broken llvm module error messageVexu
2019-11-21string literals are now null terminatedAndrew Kelley
this also deletes C string literals from the language, and then makes the std lib changes and compiler changes necessary to get the behavior tests and std lib tests passing again.
2019-11-21add null terminated pointers and arrays to self-hostedAndrew Kelley
as well as `@typeInfo` and `@Type`
2019-11-14Update discriminant value also for zero-sized unionsLemonBoy
Fixes #3681
2019-11-14rework layout of struct type fieldsAndrew Kelley
This removes the remaining hack in the implementation of anonymous struct literals, and they can now therefore now have greater than 16 fields/elements.
2019-11-14rework comptime struct value layout, removing 1/2 hacksAndrew Kelley
in the implementation of anonymous struct literals
2019-11-13Merge pull request #3675 from Vexu/atomic-storeAndrew Kelley
Add @atomicStore builtin
2019-11-12fix anonymous struct literal assigned to variableAndrew Kelley
closes #3667
2019-11-12fn parameters participate in result location semanticsAndrew Kelley
See #3665
2019-11-13add @atomicStore builtinVexu
2019-11-11fix unresolved type making it to codegenAndrew Kelley
found this trying to build oxid
2019-11-08introduce `@as` builtin for type coercionAndrew Kelley
This commit also hooks up type coercion (previously called implicit casting) into the result location mechanism, and additionally hooks up variable declarations, maintaining the property that: var a: T = b; is semantically equivalent to: var a = @as(T, b); See #1757
2019-11-07correctly use llvm undef in release modesShawn Landden
2019-11-07Fix ptrCast of array references to fnLemonBoy
Closes #3607
2019-11-05implement storing vector elements via runtime indexAndrew Kelley