From: Jim Meyering Date: Fri, 14 Aug 2009 17:33:35 +0000 (+0200) Subject: generator.ml: don't emit unused functions X-Git-Tag: 1.0.68~52^2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=fee26ee231d22481a93176b29a9629c780b45dc3;p=libguestfs.git generator.ml: don't emit unused functions * src/generator.ml: Use "rstructs_used" to emit definitions only for put_TYPE_list functions that are used. --- diff --git a/src/generator.ml b/src/generator.ml index 4fb9e4f..85344aa 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -7516,9 +7516,17 @@ py_guestfs_close (PyObject *self, PyObject *args) pr "};\n"; pr "\n"; - emit_put_list_function typ ) structs; + (* Emit a put_TYPE_list function definition only if that function is used. *) + List.iter ( + function + | typ, (RStructListOnly | RStructAndList) -> + (* generate the function for typ *) + emit_put_list_function typ + | typ, _ -> () (* empty *) + ) rstructs_used; + (* Python wrapper functions. *) List.iter ( fun (name, style, _, _, _, _, _) ->