Commit Graph

154 Commits

Author SHA1 Message Date
Christoffer Lerno
08e4757ade Some fixup of the RISCV code. 2020-11-28 19:36:12 +01:00
Christoffer Lerno
84eea12efe Initial work on RISCV - completely untested. 2020-11-28 19:02:55 +01:00
Christoffer Lerno
0889a93c4e Comment out unused code. 2020-11-27 23:46:16 +01:00
Christoffer Lerno
29730345b0 Moving llvm-emit / debug output separately. Started work on C headers. Started work getting packed unions and structs to work correctly. Also added some unfinished PIC code. 2020-11-27 23:43:39 +01:00
Christoffer Lerno
bf7318305a Adding comments to the lexer. 2020-11-25 12:24:14 +01:00
Christoffer Lerno
31e9ec3d52 Optimize load of return & some parameter types. Fix issue with non-exapanding coerce. Add support for specific arch_os in tests. 2020-11-24 20:31:18 +01:00
Christoffer Lerno
669fd8c9a9 Incorrect index on sret. Explicit fallthrough annotation on type_is_homogenous_base_type. 2020-11-24 11:46:39 +01:00
Christoffer Lerno
162bb9dac8 Add a new "target" command line option to set the target without the need for a full target triple. Add debug command line options. Fix bug with coerce for x64 SysV ABI. 2020-11-23 23:24:27 +01:00
Christoffer Lerno
1057432913 Add CMake find order for multiple LLVM installs. 2020-11-23 20:04:15 +01:00
Christoffer Lerno
f2c394dc96 Compatibility with both LLVM 10 and 11 2020-11-23 17:40:13 +01:00
Christoffer Lerno
3c15e495dd Add macro arguments &foo $foo #foo.
C ABI compatibility aarch64, win64, x86, x64
Added debug info
2020-11-22 22:16:19 +01:00
Christoffer Lerno
4222f2731e &&temp operator. Macro evaluation. 2020-10-16 18:11:30 +02:00
Christoffer Lerno
8680ce0684 Update README.md 2020-10-01 15:17:15 +02:00
kathanshukla
2751a29e08 Update README.md 2020-10-01 15:17:15 +02:00
Christoffer Lerno
340141bb76 Update README.md
Added an example.
2020-09-21 13:38:45 +02:00
Christoffer Lerno
39c7c5d0b6 Updated discord links in README. 2020-09-21 13:31:51 +02:00
Christoffer Lerno
77ccfc1f7c Added CT_SWITCH parsing in top level. Nil changed to null. Parsing more in line with grammar. Parse type as expressions. Zero init by default for locals. Corrected bool/fp conversion. Add memcpy pass to fix issue with value load/stores. 2020-09-21 11:38:12 +02:00
Christoffer Lerno
fb937156fe Work on debug + fix of failable bug. 2020-09-02 10:18:30 +02:00
Christoffer Lerno
9709cb61a4 Struct constants stored in globals. 2020-08-09 19:01:46 +02:00
Christoffer Lerno
d070a5e7ff Allow "if (...) else if (...)". Disallow 'if (...) doSomething()' unless the "doSomething" is in the same line. 2020-08-03 17:33:07 +02:00
Christoffer Lerno
b45c866071 Adding $switch and rearranging parser somewhat. Removing the need for "store" of context. 2020-08-02 13:53:17 +02:00
Christoffer Lerno
564fc6e106 Disable library detection. 2020-08-02 00:06:43 +02:00
Christoffer Lerno
31d2c15dba Adding $unreachable 2020-08-02 00:06:43 +02:00
Christoffer Lerno
009ccfd730 Adding assert. 2020-08-01 20:53:47 +02:00
Christoffer Lerno
21357c4fc1 Fix crash when having return value errors. Updated docs. Find and load builtin.c3 locate std lib. 2020-07-31 16:29:52 +02:00
Christoffer Lerno
380c1c8ab4 Support for $assert. Also change order of checking global declarations from parsing to semantic analysis. 2020-07-30 17:44:41 +02:00
Christoffer Lerno
8586bf3f8d Constants are now variables. Constant compile time constants are typeless and act as #define and are now also correctly parsed. Enums are also correctly lowered. And expressions are copied when inlining constants. Compile time ints can no longer be bitnegated. 2020-07-29 22:08:47 +02:00
Christoffer Lerno
d0ed16e60e Fixes to !! operator + tests. 2020-07-29 12:07:56 +02:00
Christoffer Lerno
7853cb09ac Added check when omitting end index for pointers. 2020-07-28 17:37:48 +02:00
Christoffer Lerno
ce68bda86c Corrected ptr->bool conversion. Avoid checking function body if function is invalid. Switch defer test cases. Slices with test cases. 2020-07-28 17:37:48 +02:00
Christoffer Lerno
90ab4f07b9 Corrected ptr->bool conversion. Avoid checking function body if function is invalid. Switch defer test cases. 2020-07-28 17:37:48 +02:00
Christoffer Lerno
c839eb50c8 Simplified defer and now also allow nested defers. 2020-07-27 11:40:45 +02:00
Christoffer Lerno
a533cbb1a7 Fixes to tester for multiple file support. 2020-07-27 11:40:45 +02:00
Christoffer Lerno
7b7abf5d4a Fixes to defer, allowing break in defer (instead of continue). Fixed bug in PTR->BOOL cast. Extended test system to support multi files and codegen. 2020-07-27 11:40:45 +02:00
Christoffer Lerno
75dd644e52 Corrected parsing for incremental arrays. Correctly handle failed declarations. More tests. 2020-07-25 21:54:32 +02:00
Christoffer Lerno
34c7df9ee1 Fixed multi line error reporting for tokens. Handle infinite empty for loops. Changed cast syntax to "cast(foo as Foo)". Completed enum casts. Added more tests. 2020-07-25 21:54:32 +02:00
Christoffer Lerno
e3566ba838 Fixed crash bug on missing module, and on file name == keyword. Added summary to tester and corrected filename. 2020-07-25 21:54:32 +02:00
Christoffer Lerno
bd68380f06 Fixes to compile time integer conversions to to unsigned values, detecting negative values. Require cast on int -> pointer cast. Fixed check on array underflow. More tests. 2020-07-25 02:43:06 +02:00
Christoffer Lerno
7e803034c2 Merge pull request #36 from c3lang/dev
Changed how structs/unions are parsed so that recovery becomes more r…
2020-07-23 18:06:22 +02:00
Christoffer Lerno
ed01616f1e Changed how structs/unions are parsed so that recovery becomes more robust. Allow for more complex error data. Fixed recursive structs/unions. Corrected prefix precedence rules. Begin work on checking initializer constant-ness. Fixed error on failed arithmetic promotion. Added checks on constant overflow of sub/add/mult. Allow "current_module_name::x" to refer to globals. Added many tests. 2020-07-23 18:04:18 +02:00
Christoffer Lerno
f45d6ef84b Fix, separate out the function pass from the decl pass. Diagnose non-visible symbols as not visible rather than missing. Fix crash when module identifier is incorrect. !! operator added. New character literal parsing. Added simple test framework. 2020-07-21 23:43:28 +02:00
Christoffer Lerno
b4c661eaad Pre lexing and mmap allocation together with exact exits. 2020-07-15 15:42:54 +02:00
Christoffer Lerno
3e76ee2643 TODO corrected 2020-07-09 16:17:08 +02:00
Christoffer Lerno
9b0f0edf19 Explicit fallthrough. 2020-07-09 16:15:44 +02:00
Christoffer Lerno
c976dc3749 Removed fallthrough. 2020-07-09 16:13:25 +02:00
Christoffer Lerno
1ddcb99711 More fixes for warnings. 2020-07-09 16:11:29 +02:00
Christoffer Lerno
3e5fefdb64 Fixed warning. 2020-07-09 16:10:02 +02:00
Christoffer Lerno
dc86c21210 New failable based error handling. Labelled break/continue/next. 2020-07-09 13:07:08 +02:00
SeekingMeaning
10f715cec0 Fixed link to C2 language in readme 2020-07-06 23:25:19 +02:00
Christoffer Lerno
a6a4136685 Updated examples and grammar for big error change. 2020-06-17 18:19:00 +02:00