cleanup notes

This commit is contained in:
pommicket 2022-02-13 22:20:49 -05:00
parent b9fd2a2b9c
commit 1f9534d750
4 changed files with 8 additions and 24 deletions

View file

@ -1,13 +1,3 @@
; @TODO : declarations need to be done differently.
; this should work, but doesn't currently;
; goto lbl1;
; {
; int x;
; lbl1: ...
; }
; CALLING CONVENTION: ; CALLING CONVENTION:
; Here is the process for calling a function: ; Here is the process for calling a function:
; - the caller pushes the arguments on to the stack, from right to left ; - the caller pushes the arguments on to the stack, from right to left
@ -2611,10 +2601,9 @@ function generate_statement
if c == STATEMENT_CASE goto gen_stmt_case if c == STATEMENT_CASE goto gen_stmt_case
if c == STATEMENT_DEFAULT goto gen_stmt_default if c == STATEMENT_DEFAULT goto gen_stmt_default
; @TODO die(.str_badgenstmt)
die(.str_genstmtNI) :str_badgenstmt
:str_genstmtNI string Bad statement passed to generate_statement.
string generate_statement not implemented.
byte 0 byte 0
:gen_block :gen_block
:gen_block_loop :gen_block_loop

View file

@ -113,7 +113,8 @@
#define NUMBER_SUFFIX_UL 3 #define NUMBER_SUFFIX_UL 3
#define NUMBER_SUFFIX_F 4 #define NUMBER_SUFFIX_F 4
; #define KEYWORD_AUTO 21 (@NONSTANDARD auto only exists in C for legacy reasons and doesn't appear in TCC's source code) ; @NONSTANDARD: we don't handle some keywords; see explanations below
; #define KEYWORD_AUTO 21 (auto only exists in C for legacy reasons)
#define KEYWORD_DOUBLE 22 #define KEYWORD_DOUBLE 22
#define KEYWORD_INT 23 #define KEYWORD_INT 23
#define KEYWORD_STRUCT 24 #define KEYWORD_STRUCT 24
@ -129,18 +130,18 @@
#define KEYWORD_EXTERN 34 #define KEYWORD_EXTERN 34
#define KEYWORD_RETURN 35 #define KEYWORD_RETURN 35
#define KEYWORD_UNION 36 #define KEYWORD_UNION 36
; #define KEYWORD_CONST 37 (we can just #define const) ; #define KEYWORD_CONST 37 (just #define const)
#define KEYWORD_FLOAT 38 #define KEYWORD_FLOAT 38
#define KEYWORD_SHORT 39 #define KEYWORD_SHORT 39
#define KEYWORD_UNSIGNED 40 #define KEYWORD_UNSIGNED 40
#define KEYWORD_CONTINUE 41 #define KEYWORD_CONTINUE 41
#define KEYWORD_FOR 42 #define KEYWORD_FOR 42
; #define KEYWORD_SIGNED 43 (again, just #define signed) ; #define KEYWORD_SIGNED 43 (just #define signed)
#define KEYWORD_VOID 44 #define KEYWORD_VOID 44
#define KEYWORD_DEFAULT 45 #define KEYWORD_DEFAULT 45
#define KEYWORD_GOTO 46 #define KEYWORD_GOTO 46
#define KEYWORD_SIZEOF 47 #define KEYWORD_SIZEOF 47
; #define KEYWORD_VOLATILE 48 (just #define volatile if need be) ; #define KEYWORD_VOLATILE 48 (just #define volatile)
#define KEYWORD_DO 49 #define KEYWORD_DO 49
#define KEYWORD_IF 50 #define KEYWORD_IF 50
#define KEYWORD_STATIC 51 #define KEYWORD_STATIC 51

View file

@ -3605,7 +3605,6 @@ function evaluate_constant_expression
expr += 8 expr += 8
return expr return expr
:eval_constant_int :eval_constant_int
; @TODO : check if 0
expr += 8 expr += 8
*8p_value = *8expr *8p_value = *8expr
expr += 8 expr += 8

View file

@ -938,11 +938,6 @@ function translation_phase_4
goto pp_if_idents0_loop goto pp_if_idents0_loop
:pp_replace_defined :pp_replace_defined
; handle, e.g. #if defined(SOMETHING) ; handle, e.g. #if defined(SOMETHING)
; @NONSTANDARD?? it seems unclear in the standard whether this is legal:
; #define X defined
; GCC and clang both accept it without warnings
p += 16 p += 16
if *1p != SYMBOL_LPAREN goto pp_defined_nolparen if *1p != SYMBOL_LPAREN goto pp_defined_nolparen
p += 16 p += 16