You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the naming of the attributes matches the spec, using separate attributes __attribute__((overlaycall)) and __attribute__((overlaydata)) for functions and global data respectively. There are a couple of possible changes that are worth discussing though:
Renaming the attributes to overlay_call and overlay_data, or alternatively maybe something like overlay_function and overlay_data.
Merging the attributes into a single overlay attribute.
The former change is mainly concerning readability. As far as I'm aware it's generally not consistent in GCC/Clang whether attributes include an underscore, but in generally snake case is acceptable and considered easier to read. Also I'm not sure whether overlay_function would be better than overlay_call because it's more explicit that the function exists in an overlay.
The second change is something which I implemented in a previous version of the Clang patch. It is possible to use a single overlay attribute and then differentiate entirely on what kind of Decl the attribute is applied to rather than using separate attributes. This makes the interface a bit simpler, but I can think of a couple of disadvatages:
Diagnostics would either be less precise, or would have to differentiate functions vs data anyway
Users might mistakenly believe that the attribute is a type attribute and then misunderstand the semantics when applying it to a global function pointer.
The text was updated successfully, but these errors were encountered:
Opening a discussion from feedback on the Clang/LLVM patches.
https://reviews.llvm.org/D109372
https://reviews.llvm.org/D109371
Currently the naming of the attributes matches the spec, using separate attributes
__attribute__((overlaycall))
and__attribute__((overlaydata))
for functions and global data respectively. There are a couple of possible changes that are worth discussing though:overlay_call
andoverlay_data
, or alternatively maybe something likeoverlay_function
andoverlay_data
.overlay
attribute.The former change is mainly concerning readability. As far as I'm aware it's generally not consistent in GCC/Clang whether attributes include an underscore, but in generally snake case is acceptable and considered easier to read. Also I'm not sure whether
overlay_function
would be better thanoverlay_call
because it's more explicit that the function exists in an overlay.The second change is something which I implemented in a previous version of the Clang patch. It is possible to use a single
overlay
attribute and then differentiate entirely on what kind of Decl the attribute is applied to rather than using separate attributes. This makes the interface a bit simpler, but I can think of a couple of disadvatages:The text was updated successfully, but these errors were encountered: