310 Commits

Author SHA1 Message Date
Rui Ueyama
d367510fcc Add #include "..." 2020-12-07 12:00:06 +09:00
Rui Ueyama
146c7b3dd4 Add the null directive 2020-12-07 12:00:06 +09:00
Rui Ueyama
1e1ea39dad Add a do-nothing preprocessor 2020-12-07 12:00:06 +09:00
Rui Ueyama
8b726b5489 Run "ld" unless -c is given 2020-12-07 12:00:06 +09:00
Rui Ueyama
b833cd0f29 Accept multiple input files 2020-12-07 12:00:06 +09:00
Rui Ueyama
140b43358c Run "as" command unless -S is given 2020-12-07 12:00:06 +09:00
Rui Ueyama
f3d96136f2 Split cc1 from compiler driver 2020-12-07 12:00:06 +09:00
Rui Ueyama
53e81033ce Add usual arithmetic conversion for function pointer 2020-12-07 12:00:06 +09:00
Rui Ueyama
c5953ba132 Decay a function to a pointer in the func param context 2020-12-07 12:00:06 +09:00
Rui Ueyama
d06a8ac6e6 Add function pointer 2020-12-07 12:00:06 +09:00
Rui Ueyama
5d15431df1 Add stage2 build 2020-12-07 12:00:06 +09:00
Rui Ueyama
9bf96124ba Add "long double" as an alias for "double" 2020-12-07 12:00:06 +09:00
Rui Ueyama
ffea4219b1 Add flonum constant expression 2020-12-07 12:00:06 +09:00
Rui Ueyama
e452cf7215 Support variadic function with floating-point parameters 2020-12-07 12:00:06 +09:00
Rui Ueyama
8b14859f63 Implement default argument promotion for float 2020-12-07 12:00:06 +09:00
Rui Ueyama
c6b30568b4 Allow to define a function that takes/returns flonums 2020-12-07 12:00:06 +09:00
Rui Ueyama
8ec1ebf176 Allow to call a function that takes/returns flonums 2020-12-07 12:00:06 +09:00
Rui Ueyama
0ce1093027 Handle flonum for if, while, do, !, ?:, || and && 2020-12-07 12:00:06 +09:00
Rui Ueyama
83f76ebb66 Add flonum +, -, * and / 2020-12-07 12:00:06 +09:00
Rui Ueyama
cf9ceecb2f Add flonum ==, !=, < and <= 2020-12-07 12:00:06 +09:00
Rui Ueyama
29de46aed4 Add "float" and "double" local variables and casts 2020-12-07 12:00:06 +09:00
Rui Ueyama
1e57f72d8a Add floating-point constant 2020-12-07 12:00:06 +09:00
Rui Ueyama
1fad2595d6 Allow to omit parameter name in function declaration 2020-12-07 12:00:06 +09:00
Rui Ueyama
93d12771d0 Ignore "static" and "const" in array-dimensions 2020-12-07 12:00:06 +09:00
Rui Ueyama
b773554275 Ignore const, volatile, auto, register, restrict or _Noreturn. 2020-12-07 12:00:06 +09:00
Rui Ueyama
7ba6fe8d94 Handle unsigned types in the constant expression 2020-12-07 12:00:06 +09:00
Rui Ueyama
6880a39d2a When comparing two pointers, treat them as unsigned 2020-12-07 12:00:06 +09:00
Rui Ueyama
8b8f3de48b Use long or ulong instead of int for some expressions 2020-12-07 12:00:06 +09:00
Rui Ueyama
aaf10459d9 Add U, L and LL suffixes 2020-12-07 12:00:06 +09:00
Rui Ueyama
34ab83bdf4 Add unsigned integral types 2020-12-07 12:00:06 +09:00
Rui Ueyama
3f59ce7955 Add signed keyword 2020-12-07 12:00:06 +09:00
Rui Ueyama
197689a22b Check the number of function arguments 2020-12-07 12:00:06 +09:00
Rui Ueyama
754a24fafc Add va_start to support variadic functions 2020-12-07 12:00:06 +09:00
Rui Ueyama
58fc86137c Allow to call a variadic function 2020-12-07 12:00:06 +09:00
Rui Ueyama
dcd4579226 Handle a function returning bool, char or short
x86-64 psABI says that only the least significant 8 bits are
significant if RAX has a return value of a function returning bool.
Likewise, it looks like only the least significant 1 or 2 bytes
are guaranteed to have a correct value for char and short return
values, respectively.
2020-12-07 12:00:06 +09:00
Rui Ueyama
6a0ed71107 Align stack frame to 16 byte boundaries 2020-12-07 12:00:06 +09:00
Rui Ueyama
ee252e6ce7 Add do ... while 2020-12-07 12:00:06 +09:00
Rui Ueyama
eb85527656 Add static global variables 2020-12-07 12:00:06 +09:00
Rui Ueyama
30b3e216cd Add return that doesn't take any value 2020-12-07 12:00:06 +09:00
Rui Ueyama
127056dc1d Add compound literals 2020-12-07 12:00:06 +09:00
Rui Ueyama
319772b42e Add static local variables 2020-12-07 12:00:06 +09:00
Rui Ueyama
310a87e15e [GNU] Allow a variable as an operand of _Alignof 2020-12-07 12:00:06 +09:00
Rui Ueyama
9df51789e7 Add _Alignof and _Alignas 2020-12-07 12:00:06 +09:00
Rui Ueyama
27647455e4 Handle extern declarations in a block 2020-12-07 12:00:06 +09:00
Rui Ueyama
006a45ccd4 Add extern 2020-12-07 12:00:06 +09:00
Rui Ueyama
157356c769 Align global variables 2020-12-07 12:00:06 +09:00
Rui Ueyama
7a1f816783 Accept void as a parameter list
`foo(void)` indicate that function foo does not take a parameter.
2020-12-07 12:00:06 +09:00
Rui Ueyama
cd688a89b8 Allow to initialize struct flexible array member 2020-12-07 12:00:06 +09:00
Rui Ueyama
824543bb2f Add flexible array member 2020-12-07 12:00:06 +09:00
Rui Ueyama
3d216e3e06 Emit uninitialized global data to .bss instead of .data 2020-12-07 12:00:06 +09:00