From 1d943da0cf9154e7ce78ce867cdbb91531c5d78e Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Tue, 25 Jul 2023 14:58:33 -0700 Subject: initial dietc commit --- docs/CHIBICC_MODS.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 docs/CHIBICC_MODS.txt (limited to 'docs/CHIBICC_MODS.txt') diff --git a/docs/CHIBICC_MODS.txt b/docs/CHIBICC_MODS.txt new file mode 100644 index 0000000..ab733ba --- /dev/null +++ b/docs/CHIBICC_MODS.txt @@ -0,0 +1,14 @@ +we're attempting to stay as close to mainline chibicc as possible + +at a high level, the major changes made are: +- strip out most of proprocess.c, as we're OK with using GCC's preprocessor + (still need preprocess.c, as it handles parsing of literals) +- add a typegen.c, which runs before codegen & outputs the typedefs +- replace codegen.c to output C instead of assembly + +to support these, ended up making some changes to the rest of the files. these +include: + - in type.c:usual_arith_conv, + - don't cast if they're already the right type + - for pointer arithmetic, leave it as pointer + long + - in parse.c:is_const_expr, also allow modulos to be const -- cgit v1.2.3