Commit Graph

122 Commits

Author SHA1 Message Date
Rui Ueyama 44bea4c85a Add __attribute__((packed)) 2020-12-07 12:00:06 +09:00
Rui Ueyama d69a11dd25 Add _Atomic and atomic ++, -- and op= operators 2020-12-07 12:00:06 +09:00
Rui Ueyama 80ea9d427c Add atomic_exchange 2020-12-07 12:00:06 +09:00
Rui Ueyama ca27455b92 Add atomic_compare_exchange 2020-12-07 12:00:06 +09:00
Rui Ueyama 1e9b6dd110 Add -static option 2020-12-07 12:00:06 +09:00
Rui Ueyama 86785fceb1 Add -fpic and -fPIC options 2020-12-07 12:00:06 +09:00
Rui Ueyama 0aad326f35 Add string hashmap 2020-12-07 12:00:06 +09:00
Rui Ueyama f0c98e0d59 [GNU] Treat labels-as-values as compile-time constant 2020-12-07 12:00:06 +09:00
Rui Ueyama 4f165ec60b [GNU] Support labels-as-values 2020-12-07 12:00:06 +09:00
Rui Ueyama d90c73b605 [GNU] Support case ranges 2020-12-07 12:00:06 +09:00
Rui Ueyama e0bf168041 Add long double 2020-12-07 12:00:06 +09:00
Rui Ueyama 07f901057f Add pointer arithmetic for VLA 2020-12-07 12:00:06 +09:00
Rui Ueyama e8667afd08 Add sizeof() for VLA 2020-12-07 12:00:06 +09:00
Rui Ueyama 77275c546a Add alloca() 2020-12-07 12:00:06 +09:00
Rui Ueyama 8f5ff07dc0 Add -include option 2020-12-07 12:00:06 +09:00
Rui Ueyama b3772845bd Add thread-local variable 2020-12-07 12:00:06 +09:00
Rui Ueyama 6d344ed945 Add -fcommon and -fno-common flags 2020-12-07 12:00:06 +09:00
Rui Ueyama 85e46b1071 Add tentative definition 2020-12-07 12:00:06 +09:00
Rui Ueyama 6a2dc5a48a Use __attribute__((format(print, ...))) to find programming errors 2020-12-07 12:00:06 +09:00
Rui Ueyama e5f4ca90fd Do not emit static inline functions if referenced by no one 2020-12-07 12:00:06 +09:00
Rui Ueyama 31087f8d4b Handle inline functions as static functions 2020-12-07 12:00:06 +09:00
Rui Ueyama a2535163e2 Add basic "asm" statement 2020-12-07 12:00:06 +09:00
Rui Ueyama 1433b404d6 [GNU] Add __builtin_types_compatible_p 2020-12-07 12:00:06 +09:00
Rui Ueyama c61c0d0025 Add #line 2020-12-07 12:00:06 +09:00
Rui Ueyama 37998be0c1 Improve error message for multibyte characters 2020-12-07 12:00:06 +09:00
Rui Ueyama 238277714d Allow to concatenate regular string literals with L/u/U string literals 2020-12-07 12:00:06 +09:00
Rui Ueyama 0e5d250ebf Allow multibyte UTF-8 character in identifier 2020-12-07 12:00:06 +09:00
Rui Ueyama a57c661d46 Accept multibyte character as wide character literal
On most Unix-like systems, wide character literal is 32-bit long
and encodes a Unicode code point. On Windows, that is 16-bit
long and encodes a UTF-16 code unit. Clearly, there's a portability
issue here. Personally I've never used wide characters in my code
as I didn't find it useful.

Being said that, some header files contain wide character literal,
so we need to support that so that chibicc can include such files.

We assume that source files are always encoded in UTF-8.
2020-12-07 12:00:06 +09:00
Rui Ueyama c31886aa7a Add \u and \U escape sequences 2020-12-07 12:00:06 +09:00
Rui Ueyama e27417fcde Add __DATE__ and __TIME__ macros 2020-12-07 12:00:06 +09:00
Rui Ueyama 2c91da54df Turn on -Wall compiler flag and fix compiler warnings 2020-12-07 12:00:06 +09:00
Rui Ueyama cc852fe99d Add bitfield 2020-12-07 12:00:06 +09:00
Rui Ueyama be8b6f6d31 Add -U option 2020-12-07 12:00:06 +09:00
Rui Ueyama fc69f5c6f9 Add -D option 2020-12-07 12:00:06 +09:00
Rui Ueyama 3f2c2d5bca Tokenize numeric tokens as pp-numbers 2020-12-07 12:00:06 +09:00
Rui Ueyama c72df1c9be Allow to call a fucntion returning a struct 2020-12-07 12:00:06 +09:00
Rui Ueyama b29f052102 Support passed-on-stack arguments 2020-12-07 12:00:06 +09:00
Rui Ueyama 6f17071885 Add __FILE__ and __LINE__ 2020-12-07 12:00:06 +09:00
Rui Ueyama a1dd6213c8 Add -I<dir> option 2020-12-07 12:00:06 +09:00
Rui Ueyama d85fc4ffcf Add #include <...> 2020-12-07 12:00:06 +09:00
Rui Ueyama 8f6f7925a0 Add macro stringizing operator (#) 2020-12-07 12:00:06 +09:00
Rui Ueyama dec3b3fa02 Add zero-arity funclike #define 2020-12-07 12:00:06 +09:00
Rui Ueyama acce00228b Do not expand a token more than once for the same objlike macro 2020-12-07 12:00:06 +09:00
Rui Ueyama bf6ff928ad Add #if and #endif 2020-12-07 12:00:06 +09:00
Rui Ueyama ec149f64d2 Skip extra tokens after `#include "..."` 2020-12-07 12:00:06 +09:00
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 140b43358c Run "as" command unless -S is given 2020-12-07 12:00:06 +09:00