tra added a comment.

> Type struct __tgt_offload_entry {
>
>   void    *addr;      // Pointer to the offload entry info.
>                       // (function or global)
>   char    *name;      // Name of the function or global.
>   size_t  size;       // Size of the entry info (0 if it a function).
>   int32_t flags;
>   int32_t reserved;
>
> };

One thing you need to consider is that this introduces a new ABI. 
This structure may change over time and we will need to be able to deal with 
libraries compiled with potentially different version of clang which may use a 
different format for the entries.
I think we may need some sort of version stamp.
We could use the section name for this purpose and rename it when we change the 
struct format, but that would be a bit more fragile as it's easier to forget to 
update the name if/when the struct format changes.
Also, format mismatch would looks like offload section is missing, which would 
need special handling when we diagnose the problem to distinguish incompatible 
offload table from the missing offload table.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123471/new/

https://reviews.llvm.org/D123471

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to