summaryrefslogtreecommitdiff
path: root/05
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-13 22:20:49 -0500
committerpommicket <pommicket@gmail.com>2022-02-13 22:20:49 -0500
commit1f9534d750d6edb2af39ff9da544ae129ba9a146 (patch)
treecaa16e2ca08690ee834fa56650c960e622f21496 /05
parentb9fd2a2b9cfd2f1a84223adc9aa3dc20d74436b4 (diff)
cleanup notes
Diffstat (limited to '05')
-rw-r--r--05/codegen.b17
-rw-r--r--05/constants.b9
-rw-r--r--05/parse.b1
-rw-r--r--05/preprocess.b5
4 files changed, 8 insertions, 24 deletions
diff --git a/05/codegen.b b/05/codegen.b
index 548bc9e..cd70a22 100644
--- a/05/codegen.b
+++ b/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
diff --git a/05/constants.b b/05/constants.b
index c4c4676..fd8a382 100644
--- a/05/constants.b
+++ b/05/constants.b
@@ -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
diff --git a/05/parse.b b/05/parse.b
index e214a4a..93de88e 100644
--- a/05/parse.b
+++ b/05/parse.b
@@ -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
diff --git a/05/preprocess.b b/05/preprocess.b
index 2a94119..f5aac22 100644
--- a/05/preprocess.b
+++ b/05/preprocess.b
@@ -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