Andrew Kelley
29defd705d
back to AT&T syntax for assembly
...
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-30 11:28:11 -04:00
Andrew Kelley
bf67427c67
fix crash when using zig to link
...
without explicit dynamic linker
2017-04-13 01:15:25 -04:00
Andrew Kelley
41144a8566
ability to inline at function callsite
...
closes #306
2017-04-13 00:13:54 -04:00
Andrew Kelley
7f47b0c271
run alwaysinline pass in debug mode
...
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-11 03:37:44 -04:00
Andrew Kelley
5c04730534
use intel dialect for inline assembly
...
closes #242
2017-03-23 18:59:43 -04:00
Andrew Kelley
d10bbd28e9
use lld instead of system linker
2017-03-13 11:54:56 -04:00
Andrew Kelley
cd31f875a6
update to llvm 4.0
2017-03-10 02:29:01 -05:00
Andrew Kelley
573f3f8d48
coldcc works better
...
* Only use Cold Calling Convention on x86
* Add the cold attribute to functions marked with coldcc
2017-02-06 13:50:19 -05:00
Andrew Kelley
b9c943b066
tell LLVM the target sub arch type
2017-02-05 18:23:54 -05:00
Andrew Kelley
74d41ce44b
infer hard float from target environments that imply it
2017-02-05 00:16:49 -05:00
Andrew Kelley
1fa4d2a5af
rename LLVMZig to ZigLLVM
2016-09-10 20:53:57 -04:00
Andrew Kelley
20eb749ad6
generate debug info for global constants
...
See #41
2016-09-04 22:32:23 -07:00
Andrew Kelley
4e7effd3d3
port to llvm 3.9
2016-09-04 18:30:40 -07:00
Andrew Kelley
404defd99b
add div_exact builtin fn
...
closes #149
2016-05-07 20:53:16 -07:00
Andrew Kelley
100802cdc0
add debug safety for left shifting
...
See #46
2016-05-06 15:46:38 -07:00
Andrew Kelley
c95e497857
add cmpxchg builtin function
2016-05-04 18:19:49 -07:00
Andrew Kelley
a299de2265
better alignment value for stack variables
...
fixes debug info sometimes not being available for parameters
2016-04-28 15:10:27 -07:00
Andrew Kelley
4815c03caa
better parameter codegen
...
* ability to take address of a parameter (closes #97 )
* debug symbols work for parameters
2016-04-27 17:34:53 -07:00
Andrew Kelley
7026bed462
fix debug symbols regression after llvm 3.8.0
2016-04-09 14:21:55 -07:00
Andrew Kelley
76e1541803
update to llvm 3.8.0
2016-03-08 18:56:14 -07:00
Andrew Kelley
58c13aa949
rename 'environ' to 'env_type'
...
environ appears to clash with another symbol in mingw land
2016-02-16 20:03:41 -07:00
Andrew Kelley
9bf9be9937
fix build on GCC
2016-02-12 14:07:12 -07:00
Andrew Kelley
2bf6c28bc3
ability to cross compile
...
hello_libc.zig can produce a windows build
2016-02-11 01:33:27 -07:00
Andrew Kelley
54a8b6a110
cleanup target data organization
2016-02-10 16:58:15 -07:00
Andrew Kelley
b642604691
targets command shows which ones are native
2016-02-10 16:35:07 -07:00
Andrew Kelley
1ff2edf67e
add "targets" command to list architectures, oses, abis
2016-02-10 15:41:50 -07:00
realazthat
54fbe7560e
Added code for generating nonnull attributes
2016-02-05 16:29:26 -05:00
Andrew Kelley
b87d0abefe
fix debug info for bool type
2016-02-04 14:02:37 -07:00
Andrew Kelley
815d9a7994
fix debug info for arrays being 1 element too short
2016-02-03 02:44:21 -07:00
Andrew Kelley
41b95cc237
parseh: correct debug for forward decls
...
also C typedefs emit simply `const Foo = Bar;`
since in C you can implicitly cast from a typedef
child to parent but in zig you can't.
2016-01-31 17:48:19 -07:00
Andrew Kelley
32821e7098
add function pointer support
...
See #14
2016-01-18 16:42:45 -07:00
Andrew Kelley
3a326d5005
pave the road for function pointers
...
See #14
2016-01-18 08:50:10 -07:00
Andrew Kelley
8d60ffe314
solve the mystery of undefined reference error
...
big surprise, C++ is to blame
2016-01-15 17:12:26 -07:00
Andrew Kelley
2061cd50c0
resolve enum types and emit debug info
2016-01-11 00:25:17 -07:00
Andrew Kelley
fb1e3a5be9
codegen: emit debug metadata for parameters
2016-01-02 20:42:32 -07:00
Andrew Kelley
e4cb28dbf2
structs have debug information
2015-12-16 17:11:35 -07:00
Andrew Kelley
a10277bd94
prepare codebase for struct and string support
...
parsing code for structs, strings, and c string literals
partial semantic analyzing code for structs, strings, and c string literals
2015-12-12 00:10:37 -07:00
Andrew Kelley
2f0e4e9cb2
codegen does signed, unsigned, and floating point math
2015-12-08 12:25:30 -07:00
Andrew Kelley
113f0c9450
add local variables to debug info
2015-12-07 23:09:48 -07:00
Andrew Kelley
9c9ea93519
integrate debug scopes with block context
2015-12-07 22:11:04 -07:00
Andrew Kelley
1279fe0caa
all variables have memory addresses
2015-12-07 20:57:45 -07:00
Andrew Kelley
b66fb607bf
add debugging info for array type
2015-12-07 20:07:46 -07:00
Andrew Kelley
f8ca6c70c7
add labels and goto
2015-12-03 00:47:35 -07:00
Andrew Kelley
b77c423f77
all LLVM C++ API contained to one file
2015-11-30 14:43:23 -07:00
Andrew Kelley
4ccb98bdce
analyze no longer depends on llvm C++ API
2015-11-30 14:10:07 -07:00
Andrew Kelley
855d51840d
remove LLVMZigTargetMachineEmitToFile
...
The llvm C API provided function is adequate.
2015-11-29 11:12:40 -07:00
Andrew Kelley
f6529341a2
ability to export .o file
2015-11-27 22:13:39 -07:00
Andrew Kelley
024052b448
add pub and export visibility modifiers and optimization
2015-11-27 15:46:06 -07:00
Andrew Kelley
baf5167171
fix not using subtarget features
2015-11-24 15:01:37 -07:00
Andrew Kelley
c2e5d50027
write object file and fix void return type
2015-11-24 13:00:38 -07:00