diff options
| author | Alasdair | 2021-03-05 16:52:35 +0000 |
|---|---|---|
| committer | Alasdair | 2021-03-05 17:13:07 +0000 |
| commit | 212b16bd15ea39ae3b35efdce7cef549fe4f1657 (patch) | |
| tree | 94a9bd3904ef46a5fb98df9f024ed5aebce141c4 /src/jib/c_codegen.ml | |
| parent | ace7b32fe420234575ad7564f64c76309e3a74b3 (diff) | |
Add more location information to IR
Diffstat (limited to 'src/jib/c_codegen.ml')
| -rw-r--r-- | src/jib/c_codegen.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jib/c_codegen.ml b/src/jib/c_codegen.ml index b92713ff..59229126 100644 --- a/src/jib/c_codegen.ml +++ b/src/jib/c_codegen.ml @@ -826,7 +826,7 @@ let rec codegen_instr fid ctx (I_aux (instr, (_, l))) = ksprintf string " KILL(%s)(&%s);" (sgen_ctyp_name ctyp) (sgen_name ctyp id) | I_init (ctyp, id, cval) -> - codegen_instr fid ctx (idecl ctyp id) ^^ hardline + codegen_instr fid ctx (idecl l ctyp id) ^^ hardline ^^ codegen_conversion Parse_ast.Unknown ctx (CL_id (id, ctyp)) cval | I_reinit (ctyp, id, cval) -> @@ -1496,10 +1496,10 @@ let codegen_def_body ctx = function | CDEF_let (number, bindings, instrs) -> let instrs = add_local_labels instrs in let setup = - List.concat (List.map (fun (id, ctyp) -> [idecl ctyp (global id)]) bindings) + List.concat (List.map (fun (id, ctyp) -> [idecl (id_loc id) ctyp (global id)]) bindings) in let cleanup = - List.concat (List.map (fun (id, ctyp) -> [iclear ctyp (global id)]) bindings) + List.concat (List.map (fun (id, ctyp) -> [iclear ~loc:(id_loc id) ctyp (global id)]) bindings) in hardline ^^ string (Printf.sprintf "void sail_create_letbind_%d(sail_state *state) " number) ^^ string "{" |
