mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-13 11:00:29 +02:00
These annotations allow for a given type or parameter to be treated as "compatible" even if data layout analysis can't infer this automatically. assume_compatible_data_layout is more powerful than is_opaque, since it allows for structs containing members of a certain type to be automatically inferred as "compatible". Conversely however, is_opaque enforces that the underlying data is never accessed directly, since non-pointer uses of the type would still be detected as "incompatible".
33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
namespace fexgen {
|
|
struct returns_guest_pointer {};
|
|
struct custom_host_impl {};
|
|
struct custom_guest_entrypoint {};
|
|
|
|
struct generate_guest_symtable {};
|
|
struct indirect_guest_calls {};
|
|
|
|
struct callback_annotation_base {
|
|
// Prevent annotating multiple callback strategies
|
|
bool prevent_multiple;
|
|
};
|
|
struct callback_stub : callback_annotation_base {};
|
|
struct callback_guest : callback_annotation_base {};
|
|
|
|
struct type_annotation_base { bool prevent_multiple; };
|
|
|
|
// Pointers to types annotated with this will be passed through without change
|
|
struct opaque_type : type_annotation_base {};
|
|
|
|
// Function parameter annotation.
|
|
// Pointers are passed through to host (extending to 64-bit if needed) without modifying the pointee.
|
|
// The type passed to Host will be guest_layout<pointee_type>*.
|
|
struct ptr_passthrough {};
|
|
|
|
// Type / Function parameter annotation.
|
|
// Assume objects of the given type are compatible across architectures,
|
|
// even if the generator can't automatically prove this. For pointers, this refers to the pointee type.
|
|
// NOTE: In contrast to opaque_type, this allows for non-pointer members with the annotated type to be repacked automatically.
|
|
struct assume_compatible_data_layout : type_annotation_base {};
|
|
|
|
} // namespace fexgen
|