Commit Graph

11 Commits

Author SHA1 Message Date
Andrew Kelley
3b3649b86f refactor stack trace code to remove global state 2018-03-10 01:38:40 -05:00
Andrew Kelley
60b2031831 improvements to stack traces
* @panic generates an error return trace
 * printing an error return trace no longer interferes with
   normal stack traces.
 * instead of ignore_frame_count, we look at the return address
   when you call panic, and that's the first stack trace function
   makes stack traces much cleaner - the error return trace
   flows gracefully into the stack trace
2018-03-10 01:38:40 -05:00
Andrew Kelley
3671582c15 syntax: functions require return type. remove ->
The purpose of this is:

 * Only one way to do things
 * Changing a function with void return type to return a possible
   error becomes a 1 character change, subtly encouraging
   people to use errors.

See #632

Here are some imperfect sed commands for performing this update:

remove arrow:

```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```

add void:

```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```

Some cleanup may be necessary, but this should do the bulk of the work.
2018-01-25 04:10:11 -05:00
Andrew Kelley
cf39819478 add new kind of test: generating .h files. and more
* docgen supports obj_err code kind for demonstrating
   errors without explicit test cases
 * add documentation for `extern enum`. See #367
 * remove coldcc keyword and add @setIsCold. See #661
 * add compile errors for non-extern struct, enum, unions
   in function signatures
 * add .h file generation for extern struct, enum, unions
2018-01-22 22:24:07 -05:00
Andrew Kelley
6ec9933fd8 fix getting debug info twice in default panic handler 2018-01-15 16:26:13 -05:00
Andrew Kelley
c9ac607bd3 add builtin.have_error_return_tracing 2018-01-15 00:14:14 -05:00
Andrew Kelley
32ea6f54e5 *WIP* proof of concept error return traces 2018-01-12 02:12:11 -05:00
Andrea Orru
3182857224 Adding zen support 2018-01-07 04:43:08 -05:00
Andrew Kelley
c6295fe9ab remove zigrt
adds test case for #394

partially reverts a32b5929cc
2017-09-30 20:21:57 -04:00
Andrew Kelley
a32b5929cc add stack protector safety when linking libc
* introduce zigrt file. it contains only weak symbols so that
   multiple instances can be merged. it contains __zig_panic
   so that multiple .o files can call the same panic function.
 * remove `@setFnVisible` builtin and add @setGlobalLinkage builtin
   which is more powerful
 * add `@panic` builtin function.
 * fix collision of symbols with extern prototypes and internal
   function names
 * add stack protector safety when linking against libc. To add
   the safety mechanism without libc requires implementing
   Thread Local Storage. See #276
2017-03-26 21:07:07 -04:00
Andrew Kelley
5bc9feb5cb organize std and make import relative to current file
closes #216
2017-03-26 06:39:28 -04:00