diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-11-12 13:42:22 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-11-12 13:42:22 +0000 |
commit | ce4951549999f403446415c135ad1403a16a15c3 (patch) | |
tree | cac9bbb2fea29fce331916b277c38ed8fe29e471 /powerpc | |
parent | dcb9f48f51cec5e864565862a700c27df2a1a7e6 (diff) |
Globalenvs: allocate one-byte block with permissions Nonempty for each
function definition, so that comparisons between function pointers
are correctly defined.
AST, Globalenvs, and many other files:
represent programs as a list of (function or variable) definitions
instead of two lists, one for functions and the other for variables.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2067 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'powerpc')
-rw-r--r-- | powerpc/PrintAsm.ml | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/powerpc/PrintAsm.ml b/powerpc/PrintAsm.ml index ac9a5da..5bfd3ee 100644 --- a/powerpc/PrintAsm.ml +++ b/powerpc/PrintAsm.ml @@ -881,7 +881,7 @@ let function_needs_stub name = (* Generation of whole programs *) -let print_fundef oc (name, defn) = +let print_fundef oc name defn = match defn with | Internal code -> print_function oc name code @@ -890,13 +890,12 @@ let print_fundef oc (name, defn) = | External _ -> () -let record_extfun (name, defn) = - match defn with - | Internal _ -> () - | External (EF_external _ | EF_malloc | EF_free) -> +let record_extfun (name, gd) = + match gd with + | Gfun(External (EF_external _ | EF_malloc | EF_free)) -> if function_needs_stub name then stubbed_functions := IdentSet.add name !stubbed_functions - | External _ -> () + | _ -> () let print_init oc = function | Init_int8 n -> @@ -930,7 +929,7 @@ let print_init_data oc name id = else List.iter (print_init oc) id -let print_var oc (name, v) = +let print_var oc name v = match v.gvar_init with | [] -> () | _ -> @@ -963,9 +962,13 @@ let print_var oc (name, v) = (1 lsl align) end +let print_globdef oc (name, gdef) = + match gdef with + | Gfun f -> print_fundef oc name f + | Gvar v -> print_var oc name v + let print_program oc p = stubbed_functions := IdentSet.empty; - List.iter record_extfun p.prog_funct; - List.iter (print_var oc) p.prog_vars; - List.iter (print_fundef oc) p.prog_funct + List.iter record_extfun p.prog_defs; + List.iter (print_globdef oc) p.prog_defs |