ispras / qdt

QEMU Development Toolkit
Other
36 stars 8 forks source link

Foreign types and variables in `extra_references` attribute #77

Closed BDanAnd closed 3 years ago

BDanAnd commented 3 years ago

This series of patches adds the ability to use types and variables from other modules as extra dependencies.

v3

v2

v1.1

laerreal commented 3 years ago

v1.1 is ready.

There is a problem with foreign_gl global in the test. It's never defined (only declared in the "foreign_gl.h"). As a result, it comes in provide_chunks with None definer (passed by extra_references handling algorithm for gl). It's actually a logical error in the model definition. Should we raise an exception in such a situation? Note that TypeFixerVisitor does handle Types only. So foreign_gl is not added to "testextrareferences.c" automatically when gl variable is added to the module. Looks like TypeFixerVisitor should add globals too. As a result, foreign_gl is defined (chunk only, not logically) in "testextrareferences.c" because extra_references handling algorithm works quite straightforward. It definitely should not work correctly on incorrect data (foreign_gl's definer is None).

What do u think?

BDanAnd commented 3 years ago

v2 is ready.

laerreal commented 3 years ago

v3 is ready. Merge it by self if the changes are ok.