cleanup notes
This commit is contained in:
parent
b9fd2a2b9c
commit
1f9534d750
4 changed files with 8 additions and 24 deletions
17
05/codegen.b
17
05/codegen.b
|
@ -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:
|
||||
; Here is the process for calling a function:
|
||||
; - 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_DEFAULT goto gen_stmt_default
|
||||
|
||||
; @TODO
|
||||
die(.str_genstmtNI)
|
||||
:str_genstmtNI
|
||||
string generate_statement not implemented.
|
||||
die(.str_badgenstmt)
|
||||
:str_badgenstmt
|
||||
string Bad statement passed to generate_statement.
|
||||
byte 0
|
||||
:gen_block
|
||||
:gen_block_loop
|
||||
|
|
|
@ -113,7 +113,8 @@
|
|||
#define NUMBER_SUFFIX_UL 3
|
||||
#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_INT 23
|
||||
#define KEYWORD_STRUCT 24
|
||||
|
@ -129,18 +130,18 @@
|
|||
#define KEYWORD_EXTERN 34
|
||||
#define KEYWORD_RETURN 35
|
||||
#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_SHORT 39
|
||||
#define KEYWORD_UNSIGNED 40
|
||||
#define KEYWORD_CONTINUE 41
|
||||
#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_DEFAULT 45
|
||||
#define KEYWORD_GOTO 46
|
||||
#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_IF 50
|
||||
#define KEYWORD_STATIC 51
|
||||
|
|
|
@ -3605,7 +3605,6 @@ function evaluate_constant_expression
|
|||
expr += 8
|
||||
return expr
|
||||
:eval_constant_int
|
||||
; @TODO : check if 0
|
||||
expr += 8
|
||||
*8p_value = *8expr
|
||||
expr += 8
|
||||
|
|
|
@ -938,11 +938,6 @@ function translation_phase_4
|
|||
goto pp_if_idents0_loop
|
||||
:pp_replace_defined
|
||||
; 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
|
||||
if *1p != SYMBOL_LPAREN goto pp_defined_nolparen
|
||||
p += 16
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue