idl-compiler: generate views after serializers

Clang eagerly instantiates templates, so if it needs a template
function for which it has a declaration but not a definition, it
will not instantiate the definition when it sees it. This causes
link errors.

In this case, the views use the serializer implementations, but are
generated before them.

Fix by generating the view implementations after the serializer
implementations that they use.
This commit is contained in:
Avi Kivity
2020-10-03 19:45:58 +03:00
parent 40b42393d2
commit a99aba9e48

View File

@@ -1037,9 +1037,9 @@ def load_file(name):
data = parse_file(name)
if data:
handle_types(data)
add_visitors(cout)
if data:
handle_objects(data, hout, cout)
add_visitors(cout)
if config.ns != '':
fprintln(cout, "}")
cout.close()