summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
Diffstat (limited to 'lisc')
-rw-r--r--lisc/tools/abi.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
index 301e160..88a59de 100644
--- a/lisc/tools/abi.ml
+++ b/lisc/tools/abi.ml
@@ -342,6 +342,11 @@ module OutIL = struct
      | Empty, () -> () in
    f 0 0 s
 
+  let bmemtype b =
+    if AB b = AB Char  then "b" else
+    if AB b = AB Short then "h" else
+    btype b
+
   let init oc = function
     | TA (Base b, tb) -> bvalue (b, tb)
     | TA (Struct s, ts) ->
@@ -351,7 +356,7 @@ module OutIL = struct
       siter oc base (s, ts)
       begin fun _ addr (TB (b, tb)) ->
         fprintf oc "\tstore%s %s, %s\n"
-          (btype b) (bvalue (b, tb)) addr;
+          (bmemtype b) (bvalue (b, tb)) addr;
       end;
       base
 
@@ -396,11 +401,7 @@ module OutIL = struct
   let typedef oc name =
     let rec f: type a. a sty -> unit = function
       | Field (b, s) ->
-        fprintf oc "%s" begin
-          if AB b = AB Char  then "b" else
-          if AB b = AB Short then "h" else
-          btype b
-        end;
+        fprintf oc "%s" (bmemtype b);
         if not (styempty s) then
           fprintf oc ", ";
         f s;