diff options
author | Jim Meyering <meyering@redhat.com> | 2009-08-14 19:33:35 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-08-14 20:41:13 +0200 |
commit | fee26ee231d22481a93176b29a9629c780b45dc3 (patch) | |
tree | 196a65df4835801c85255e6d5470de96ce8dd112 /src | |
parent | 4b940d1e349e382cb077be97af43a4893de9ea55 (diff) | |
download | libguestfs-fee26ee231d22481a93176b29a9629c780b45dc3.tar.gz libguestfs-fee26ee231d22481a93176b29a9629c780b45dc3.tar.xz libguestfs-fee26ee231d22481a93176b29a9629c780b45dc3.zip |
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.
Diffstat (limited to 'src')
-rwxr-xr-x | src/generator.ml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/generator.ml b/src/generator.ml index 4fb9e4f2..85344aae 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, _, _, _, _, _) -> |