mathis2003
8a7f37e4d3
Test for explicit parentheses error
2021-03-15 16:56:44 +01:00
mathis2003
fe212a5a33
Forced parentheses on unclear precedence ( #109 )
...
forced parentheses to resolve issue #97
2021-03-15 16:55:35 +01:00
Christoffer Lerno
6f922b85a1
Removed path in judge0 that no longer worked. Removed link to r/ProgrammingLanguages since there is no longer a C3 channel there.
2021-03-10 16:27:40 +01:00
Ananda Umamil
52ac783e6c
Fix build on x86_64-linux-musl
2021-03-07 18:34:42 +01:00
Christoffer Lerno
1d50beb330
Work on constant string and inferred array sizes.
2021-02-03 23:01:37 +01:00
Christoffer Lerno
4f064e7da2
Initial checkin of docs parsing. char is now unsigned, and signed char is "ichar".
2021-01-29 18:46:17 +01:00
Christoffer Lerno
45c4f205bb
More correct alignment. Foreach added. Removed dynamic designated array initialization. Use 16 byte alignment on arrays >= 16 for x64
2021-01-27 00:14:16 +01:00
Christoffer Lerno
26d25e3f74
Recursive references between globals are now correctly handled.
2021-01-27 00:14:16 +01:00
Christoffer Lerno
7fc12192f4
Added "distinct" types.
2021-01-24 21:10:57 +01:00
Christoffer Lerno
3a24fbfa6d
Moved examples around. Updated (and corrected) const initialization. Removed "in" keyword. Added "member" attribute domain. Many fixes in struct padding and alignment and tests. Fixed extern global.
2021-01-24 00:55:09 +01:00
Christoffer Lerno
564c93700e
Fixed bug that would intermittently arise from multiple contexts having the same pointer (should preferably be fixed in a different way later). Free all the arenas before codegen. Change "next" to "nextcase". Allow missing function parameters. Add "inline" structs.
2021-01-03 00:15:51 +01:00
Christoffer Lerno
781638d207
Bugfix to split arrays. Correctly generate const initializers on non globals for structs.
2020-12-27 22:13:45 +01:00
Christoffer Lerno
9a0b8aab0b
Small fixes
2020-12-22 23:12:32 +01:00
Christoffer Lerno
4da36dfed9
Optimized and improved aggregate initialization. Compound literal updated to Foo({ 1, 2 })-style. ".name = x" style initialization for named arguments and designated initializers. Added runtime messages on panics. subarrays convert implictly to pointers. len/len() functions. Fix taking slice of pointer. Vararg fixes
...
Consistent length typedef.
First stab at initializers.
Change compound literal to Foo({ 1, 2 }) style.
Fixed up some tests.
Optimize the zero struct codegen.
Optimize union empty initializer.
Fix issues with unions. Added alignment to globals. Added some union tests.
Use puts to emit error messages during runtime. Fixup of int[] -> int* style conversions.
Fix implicit conversion of int[3]* -> int*
Fix int[] size. Use () to invoke the length of a subarray. Fix taking a slice of a pointer. Limit the number of members in a struct.
Fixes to vararg using debug and cleanups to slices.
2020-12-22 21:55:52 +01:00
Christoffer Lerno
6a5a0f2b94
Moved ABI lowering from codegen to semantic analysis. Fixes for failables in the ABI and the codegen.
2020-12-04 19:19:57 +01:00
Christoffer Lerno
0b00fe6988
Added round/ceil/trunc/sqrt intrinsics.
2020-12-03 15:53:42 +01:00
Christoffer Lerno
ac89023a2d
Adding __free and __alloc as intrinsics (but maybe revisit that idea).
2020-12-02 22:02:36 +01:00
Christoffer Lerno
2b455b6fd0
Minor cleanup of ABI code.
2020-11-28 23:15:49 +01:00
Christoffer Lerno
025c5e6e8a
Added some more PIE/PIC code. Not quite correct yet unfortunately.
2020-11-28 22:17:32 +01:00
Christoffer Lerno
49006217e8
Added WASM ABI
2020-11-28 20:48:47 +01:00
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