mescc: Struct by value.

* build-aux/mes-snarf.scm (symbol->names, function->header,
  function->environment): Remove struct by value assignment
  workarounds.
* module/language/c99/compiler.mes (ast->info): Remove struct by value
  assignment debug printing.
This commit is contained in:
Jan Nieuwenhuizen 2017-03-17 22:45:48 +01:00
parent a4d65166c0
commit f03a2e7500
2 changed files with 5 additions and 30 deletions

View file

@ -80,19 +80,12 @@ exec ${GUILE-guile} --no-auto-compile -L $HOME/src/mes/build-aux -L build-aux -e
(define (symbol->source s i)
(string-append
(format #f "g_free++;\n")
;; FIXME: g_functions
(if GCC?
(format #f "g_cells[cell_~a] = scm_~a;\n\n" s s)
(string-append
(format #f "g_cells[cell_~a].type = scm_~a.type;\n" s s)
(format #f "g_cells[cell_~a].car = scm_~a.car;\n" s s)
(format #f "g_cells[cell_~a].cdr = scm_~a.cdr;\n\n" s s)))))
(format #f "g_cells[cell_~a] = scm_~a;\n\n" s s)))
(define (symbol->names s i)
(string-append
(if GCC?
(format #f "g_cells[cell_~a].car = cstring_to_list (scm_~a.name);\n" s s)
(format #f "g_cells[cell_~a].car = cstring_to_list (scm_~a.car);\n" s s))))
(if GCC?
(format #f "g_cells[cell_~a].car = cstring_to_list (scm_~a.name);\n" s s)
(format #f "g_cells[cell_~a].car = cstring_to_list (scm_~a.car);\n" s s)))
(define (function->header f i)
(let* ((arity (or (assoc-ref (.annotation f) 'arity)
@ -116,14 +109,7 @@ exec ${GUILE-guile} --no-auto-compile -L $HOME/src/mes/build-aux -L build-aux -e
(format #f "~a.cdr = g_function;\n" (function-builtin-name f)))
(format #f "g_functions[g_function++] = fun_~a;\n" (.name f))
(format #f "cell_~a = g_free++;\n" (.name f))
;; FIXME: g_functions
(if GCC?
(format #f "g_cells[cell_~a] = ~a;\n\n" (.name f) (function-builtin-name f))
(string-append
(format #f "g_cells[cell_~a].type = ~a.type;\n" (.name f) (function-builtin-name f))
(format #f "g_cells[cell_~a].car = ~a.car;\n" (.name f) (function-builtin-name f))
;;(format #f "g_cells[cell_~a].car = MAKE_STRING (~a.car);\n" (.name f) (function-builtin-name f))
(format #f "g_cells[cell_~a].cdr = ~a.cdr;\n\n" (.name f) (function-builtin-name f))))))
(format #f "g_cells[cell_~a] = ~a;\n\n" (.name f) (function-builtin-name f))))
(define (function->environment f i)
(string-append

View file

@ -2031,7 +2031,6 @@ _)))))
;; g_cells[i] = c;
((expr-stmt (assn-expr (array-ref (p-expr (ident ,index)) (p-expr (ident ,array))) (op ,op) ,b))
(stderr "g_cells4[]: ~s\n" array)
;;(stderr "pointer_cells4[]: ~s\n" array)
(when (not (equal? op "="))
(stderr "OOOPS4: op=~s\n" op)
@ -2044,11 +2043,6 @@ _)))))
(count (length fields))
(field-size 4) ;; FIXME:4, not fixed
(ptr (ident->pointer info array)))
(stderr "g_cells4[~a]: type=~a\n" array type)
(stderr "g_cells4[~a]: pointer=~a\n" array ptr)
(stderr "g_cells4[~a]: fields=~a\n" array fields)
(stderr "g_cells4[~a]: size=~a\n" array size)
(stderr "g_cells4[~a]: count=~a\n" array count)
(clone info #:text
(append text
(.text base)
@ -2092,11 +2086,6 @@ _)))))
(count (length fields))
(field-size 4) ;; FIXME:4, not fixed
(ptr (ident->pointer info array)))
(stderr "g_cells5[~a]: type=~a\n" array type)
(stderr "g_cells5[~a]: pointer=~a\n" array ptr)
(stderr "g_cells5[~a]: fields=~a\n" array fields)
(stderr "g_cells5[~a]: size=~a\n" array size)
(stderr "g_cells5[~a]: count=~a\n" array count)
(clone info #:text
(append text
(.text base)