From 6c0511a03c8c970435d8b97e600312ac45340801 Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 5 Sep 2006 12:32:59 +0000 Subject: Revu traitement des variables globales dans AST.program et dans Globalenvs. Adaptation frontend, backend en consequence. Integration passe C -> C#minor dans common/Main.v. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@77 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cfrontend/Ctyping.v | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cfrontend/Ctyping.v') diff --git a/cfrontend/Ctyping.v b/cfrontend/Ctyping.v index 8b2f90f2..7c6a3790 100644 --- a/cfrontend/Ctyping.v +++ b/cfrontend/Ctyping.v @@ -136,11 +136,11 @@ Inductive wt_fundef: typenv -> fundef -> Prop := wt_fundef env (External id args res). Definition add_global_var - (env: typenv) (id_ty_init: ident * type * list init_data) : typenv := - match id_ty_init with (id, ty, init) => PTree.set id ty env end. + (env: typenv) (id_ty_init: ident * list init_data * type) : typenv := + match id_ty_init with (id, init, ty) => PTree.set id ty env end. Definition add_global_vars - (env: typenv) (vars: list(ident * type * list init_data)) : typenv := + (env: typenv) (vars: list(ident * list init_data * type)) : typenv := List.fold_left add_global_var vars env. Definition add_global_fun @@ -152,7 +152,7 @@ Definition add_global_funs List.fold_left add_global_fun funs env. Definition global_typenv (p: program) := - add_global_vars (add_global_funs (PTree.empty type) p.(prog_funct)) p.(prog_defs). + add_global_vars (add_global_funs (PTree.empty type) p.(prog_funct)) p.(prog_vars). Record wt_program (p: program) : Prop := mk_wt_program { wt_program_funct: -- cgit