aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
AgeCommit message (Collapse)Author
2017-07-08better bigint/bigfloat implementationAndrew Kelley
2017-06-19workaround for llvm bugAndrew Kelley
See #393 for details
2017-06-14fix compiler segfault on `null ?? x`Andrew Kelley
closes #390
2017-06-14partial implementation of printing floating point numbers with errol3Andrew Kelley
also add bitCast builtin function. closes #387
2017-06-14progress toward windows hello world workingAndrew Kelley
2017-05-27const global values can reference each otherAndrew Kelley
Before, if you did something like: ``` const hi1 = "hi"; const hi2 = hi1; ``` This would create the "hi" data twice in the built object. But since the value is const we don't have to duplicate the data, now we take advantage of this fact. closes #336
2017-05-23building with mingw for windowsAndrew Kelley
2017-05-20flip the enum order of FloatModeAndrew Kelley
2017-05-20add setFloatMode builtin and std.math.floorAndrew Kelley
* skip installing std/rand_test.zig as it's not needed beyond running the std lib tests * add std.math.floor function * add setFloatMode builtin function to choose between builtin.FloatMode.Optimized (default) and builtin.FloatMode.Strict (Optimized is equivalent to -ffast-math in gcc)
2017-05-17typeId builtin instead of isInteger, isFloat, etcAndrew Kelley
closes #373
2017-05-09inline function call with builtin function instead...Andrew Kelley
...of special syntax. partially reverts 41144a8566a6fbd779403f6b69424bb640c94a7f closes #306
2017-05-07delete @generatedCode builtin functionAndrew Kelley
good riddance
2017-05-07rename c_long_double to c_longdoubleAndrew Kelley
to be consistent with other c primitive type names
2017-05-06builtin functions for division and remainder divisionAndrew Kelley
* add `@divTrunc` and `@divFloor` functions * add `@rem` and `@mod` functions * add compile error for `/` and `%` with signed integers * add `.bit_count` for float primitive types closes #217
2017-05-04add compile error when unable to inline a functionAndrew Kelley
See #38
2017-05-02add safe release build modeAndrew Kelley
closes #288
2017-05-01make debug safety stuff lazyAndrew Kelley
2017-05-01`@import("builtin")` instead of `@compileVar`Andrew Kelley
See #226 Closes #220
2017-04-30zig build: organize build artifactsAndrew Kelley
closes #328
2017-04-30back to AT&T syntax for assemblyAndrew Kelley
this reverts 5c04730534ea7933855429c5fc5dc7b22eba7bc2. sadly the quality of the intel dialect in llvm's assembly parser has many frustrating bugs, and generally has unfortunate syntax. the plan is to use AT&T for now since it at least works, and eventually zig will have its own assembly parser for x86 and it will be as close to NASM as possible.
2017-04-28zig puts temporary object files in zig-cache folderAndrew Kelley
See #298
2017-04-27add no-elim-base-pointer to __zig_fail functionAndrew Kelley
fixes missing frame for unwrapping an error closes #345
2017-04-27zig test no longer requires a separate test_runner.o fileAndrew Kelley
See #298
2017-04-26build system: consolidate duplicate code and moreAndrew Kelley
* add ability to add assembly files when building an exe, obj, or lib * add implicit cast from `[N]T` to `?[]const T` (closes #343) * remove link_exe and link_lib in favor of allowing build_exe and build_lib support no root zig source file
2017-04-25revert the last 3 compile time improvementsAndrew Kelley
they introduced complexity into the compiler and didn't really help. This reverts commit efa771af754281cd76a77ef22af107eb0a9aaf9a. This reverts commit 8614397110595e267b7e4e1f558bfce619e60c02. This reverts commit 13c6a58a61817ae6aae66dd1843385452fe65bd1.
2017-04-25compile time improvement - move bounds checking to function callsAndrew Kelley
once again this barely had an effect: Before: ./build size: 1.3 MB hello.zig size: 301 KB full test: 1m31.253s debug test: 19.607s hello.zig timing: Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0002 Semantic Analysis 0.0000 0.0431 0.0431 0.2262 Code Generation 0.0431 0.0660 0.0229 0.1201 LLVM Emit Object 0.0660 0.1765 0.1105 0.5795 Build Dependencies 0.1765 0.1890 0.0125 0.0655 LLVM Link 0.1890 0.1906 0.0016 0.0086 Generate .h 0.1906 0.1906 0.0000 0.0000 Total 0.0000 0.1906 0.1906 1.0000 After: ./build size: 1.3 MB hello.zig size: 300 KB full test: 1m31.882s debug test: 19.569s hello.zig timing: Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0002 Semantic Analysis 0.0000 0.0425 0.0424 0.2228 Code Generation 0.0425 0.0661 0.0236 0.1239 LLVM Emit Object 0.0661 0.1762 0.1101 0.5782 Build Dependencies 0.1762 0.1888 0.0126 0.0664 LLVM Link 0.1888 0.1905 0.0016 0.0085 Generate .h 0.1905 0.1905 0.0000 0.0000 Total 0.0000 0.1905 0.1905 1.0000
2017-04-25compile time improvement - move overflow math safety to fnsAndrew Kelley
move some boilerplate code having to do with overflow math safety to functions. Again the timing difference is not much: Before: ./build size: 1.3 MB hello.zig size: 308 KB full test: 1m33.588s debug test: 20.303s hello.zig timing: Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0002 Semantic Analysis 0.0000 0.0425 0.0425 0.2202 Code Generation 0.0425 0.0675 0.0250 0.1293 LLVM Emit Object 0.0675 0.1789 0.1114 0.5773 Build Dependencies 0.1789 0.1913 0.0124 0.0640 LLVM Link 0.1913 0.1931 0.0018 0.0091 Generate .h 0.1931 0.1931 0.0000 0.0000 Total 0.0000 0.1931 0.1931 1.0000 After: ./build size: 1.3 MB hello.zig size: 301 KB full test: 1m31.253s debug test: 19.607s hello.zig timing: Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0002 Semantic Analysis 0.0000 0.0431 0.0431 0.2262 Code Generation 0.0431 0.0660 0.0229 0.1201 LLVM Emit Object 0.0660 0.1765 0.1105 0.5795 Build Dependencies 0.1765 0.1890 0.0125 0.0655 LLVM Link 0.1890 0.1906 0.0016 0.0086 Generate .h 0.1906 0.1906 0.0000 0.0000 Total 0.0000 0.1906 0.1906 1.0000
2017-04-25compile time improvement - add __zig_panic_slice fnAndrew Kelley
move some boilerplate code having to do with panicking to a function. Here's the timing difference. It's not much: Before: full test: 1m36.511s debug test: 20.862s hello.zig Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0001 Semantic Analysis 0.0000 0.0421 0.0420 0.2109 Code Generation 0.0421 0.0620 0.0200 0.1003 LLVM Emit Object 0.0620 0.1852 0.1231 0.6180 Build Dependencies 0.1852 0.1974 0.0122 0.0615 LLVM Link 0.1974 0.1993 0.0018 0.0093 Generate .h 0.1993 0.1993 0.0000 0.0000 Total 0.0000 0.1993 0.1993 1.0000 After: full test: 1m33.588s debug test: 20.303s hello.zig Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0002 Semantic Analysis 0.0000 0.0425 0.0425 0.2202 Code Generation 0.0425 0.0675 0.0250 0.1293 LLVM Emit Object 0.0675 0.1789 0.1114 0.5773 Build Dependencies 0.1789 0.1913 0.0124 0.0640 LLVM Link 0.1913 0.1931 0.0018 0.0091 Generate .h 0.1931 0.1931 0.0000 0.0000 Total 0.0000 0.1931 0.1931 1.0000
2017-04-25add some timing diagnosticsAndrew Kelley
pass --enable-timing-info to print a nice table like this: ``` Name Start End Duration Percent Initialize 0.0000 0.0000 0.0000 0.0001 Semantic Analysis 0.0000 0.0421 0.0420 0.2109 Code Generation 0.0421 0.0620 0.0200 0.1003 LLVM Emit Object 0.0620 0.1852 0.1231 0.6180 Build Dependencies 0.1852 0.1974 0.0122 0.0615 LLVM Link 0.1974 0.1993 0.0018 0.0093 Generate .h 0.1993 0.1993 0.0000 0.0000 Total 0.0000 0.1993 0.1993 1.0000 ```
2017-04-24better stack traces for ELF x86_64Andrew Kelley
2017-04-23blocks check that their statements are voidJosh Wolfe
closes #291 This changes the error message "return value ignored" to "expression value is ignored". This is because this error also applies to {1;}, which has no function calls. Also fix ignored expression values in std and test. This caught a bug in debug.readAllocBytes where an early Eof error would have been missed. See #219.
2017-04-23make undefined as a constant value lazyAndrew Kelley
closes #268
2017-04-23fix crash when unwrapping error with no error declsAndrew Kelley
closes #339
2017-04-21rename `@ptrcast` to `@ptrCast` to follow conventionAndrew Kelley
2017-04-21zig build system supports building a libraryAndrew Kelley
See #329 Supporting work: * move std.cstr.Buffer0 to std.buffer.Buffer * add build.zig to example/shared_library/ and add an automated test for it * add std.list.List.resizeDown * improve std.os.makePath - no longer recursive - takes into account . and .. * add std.os.path.isAbsolute * add std.os.path.resolve * reimplement std.os.path.dirname - no longer requires an allocator - handles edge cases correctly
2017-04-20Add @offsetOf builtin functionRaul Leal
2017-04-19test framework supports name prefix and filter argumentAndrew Kelley
rename self hosted tests to behavior tests
2017-04-18error when building exe with no entry pointAndrew Kelley
closes #30
2017-04-18add `@fieldParentPtr` builtin functionAndrew Kelley
closes #320
2017-04-18rename `@intType` to `@IntType` to follow conventionAndrew Kelley
closes #327
2017-04-17improvements to zig build system and unwrap error safetyAndrew Kelley
* zig build system: create standard dynamic library sym links * unwrapping an error results in a panic message that contains the error name * rename error.SysResources to error.SystemResources * add std.os.symLink * add std.os.deleteFile
2017-04-13all internal functions get unnamed_addr attributeAndrew Kelley
2017-04-13typedefpocalypseAndrew Kelley
closes #314
2017-04-13ability to inline at function callsiteAndrew Kelley
closes #306
2017-04-11run alwaysinline pass in debug modeAndrew Kelley
before this commit, the optimized IR code that is displayed in --verbose mode is not actually what gets emitted to an object file. that is now corrected, and we make sure to run the alwaysinliner pass even in debug mode, so you can rely on "inline" keyword inlining a function, guaranteed. See #306
2017-04-10fix some -Wconversion errorsAndrew Kelley
2017-04-10fix mangling exported global variablesAndrew Kelley
closes #316
2017-04-08add enumTagName builtin functionAndrew Kelley
closes #299
2017-04-07ability to implicitly cast integer literal to &const IntAndrew Kelley
where Int is an integer type also introduce `@intToPtr` builtin for converting a usize to a pointer. users now have to use this instead of `(&T)(int)`. closes #311
2017-04-06fix runtime struct initialization of bitfieldAndrew Kelley
closes #308