On 2/11/22 04:35, Taylor Simpson wrote:
-#define HEXAGON_CPU_CLASS(klass) \
- OBJECT_CLASS_CHECK(HexagonCPUClass, (klass), TYPE_HEXAGON_CPU)
-#define HEXAGON_CPU(obj) \
- OBJECT_CHECK(HexagonCPU, (obj), TYPE_HEXAGON_CPU)
-#define HEXAGON_CPU_GET_CLASS(obj) \
- OBJECT_GET_CLASS(HexagonCPUClass, (obj), TYPE_HEXAGON_CPU)
+OBJECT_DECLARE_TYPE(HexagonCPU, HexagonCPUClass, HEXAGON_CPU)
typedef struct HexagonCPUClass {
/*< private >*/
If that's correct, the typedef struct HexagonCPUClass should NOT change to
typedef struct ArchCPU, and the typdef of ArchCPU below would stay.
This is the change you'd make with the current state of the world, yes.
So, If I submit the above as a standalone patch, then Philippe wouldn't need to
modify target/hexagon/cpu.h. Correct?
But no, Phil would need a change, because he introduces
typedef struct ArchCPU ArchCPU;
as a generic typedef very early. You cannot then redefine
typedef struct HexagonCPU ArchCPU;
which means that we still have to rearrange the direction of to
typedef ArchCPU HexagonCPU;
etc. But it's definitely a smaller change (and matches all of the other
targets).
I do think that the conversion to OBJECT_DECLARE_TYPE should happen first, via whichever
tree you choose.
r~