mescc: Support function-static variables.
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 4 May 2018 18:45:27 +0000 (20:45 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 4 May 2018 18:45:27 +0000 (20:45 +0200)
commitbe60b3e49be67ed4b912fb6c8f58333dfddcc5a0
treee5c61c09cd01a8b7ba6e313512497655363e15bc
parent1cd97f117295d5f7cca6102d2832b86048f83b27
mescc: Support function-static variables.

* module/language/c99/info.scm (make): Add statics field.
  (<global>): Add name and function fields.  Update callers.
  (global->string): New function.
* module/mes/M1.mes (object->M1): Update.
* module/language/c99/compiler.mes (clone): Add statics field.
  (ident->accu): For <global>, use global in text (WAS: name).
  (ident-address->accu): Likewise.
  (ident-address->base): Likewise.
  (decl-local->info): New function.
  (decl->info): New function.
  (ast->info): Use them.
  (function->info): Keep globals in object (WAS: global:value only).
* scaffold/tests/46-function-static.c: Test it.
build-aux/check-mescc.sh
module/language/c99/compiler.mes
module/language/c99/compiler.scm
module/language/c99/info.mes
module/language/c99/info.scm
module/mes/M1.mes
scaffold/tests/46-function-static.c [new file with mode: 0644]