Skip to content

Conversation

@zebullax
Copy link

@zebullax zebullax commented May 25, 2025

Issue number of the reported bug or feature request: #
Support for attributes reflection

Describe your changes
Support for attributes reflection

Disclaimer

⚠️ This is an experimental implementation for attributes reflection.
It goes down happy paths so YMMV, 🟢 stands for This work in a controlled environment, probably break in a lot of cases

Status

Feature Status Comment
^^[[nodiscard]]; 🟢
std::meta::has_identifier(r) 🟢
std::meta::is_attribute(r) 🟢
std::meta::identifier_of(r) 🟢
std::meta::attributes_of(r) 🟢
std::meta::appertain(r, v) 🟢

Note
Attribute argument support is experimental, only supports string argument of [[nodiscard]] and [[deprecated]]

Testing performed
Smoke tests here

@zebullax zebullax marked this pull request as ready for review May 25, 2025 06:04
@zebullax zebullax force-pushed the 3385R5 branch 2 times, most recently from e2aec7f to 0141d22 Compare May 25, 2025 06:22
Add test

Signed-off-by: zebullon <[email protected]>
Remove backlink

Signed-off-by: zebullon <[email protected]>
zebullax and others added 3 commits June 12, 2025 14:23
Signed-off-by: acassagnes <[email protected]>
Signed-off-by: zebullax <[email protected]>
@zebullax
Copy link
Author

zebullax commented Jun 16, 2025

@katzdm Now that most hacks are gone, could we look into merging this ?
Any other notes are also welcome ;)

zebullax added 3 commits June 19, 2025 11:00
Signed-off-by: zebullax <[email protected]>
Signed-off-by: zebullax <[email protected]>

Cleanup

Signed-off-by: zebullax <[email protected]>

Cleanup

Signed-off-by: zebullax <[email protected]>
zebullax added 2 commits June 19, 2025 13:16
* Stash

Stash

Stash

Signed-off-by: zebullax <[email protected]>

* Stash

Signed-off-by: zebullax <[email protected]>

* Stash

Signed-off-by: zebullax <[email protected]>

* Revert change to metafunction until we get something working in tablegen

Signed-off-by: zebullax <[email protected]>

* Emit the code for extractSyntacticArguments

Signed-off-by: zebullax <[email protected]>

* Check bit for escape hatch

Signed-off-by: zebullax <[email protected]>

* Fix backend to cast to derived attribute

Signed-off-by: zebullax <[email protected]>

* Fix constness and get utility out of Attr

Signed-off-by: zebullax <[email protected]>

* Fix the type of string literal we create for attr

Signed-off-by: zebullax <[email protected]>

Rename some fluff

Signed-off-by: zebullax <[email protected]>

* Fix dedup of spelling variants of same attribute

Signed-off-by: zebullax <[email protected]>

---------

Signed-off-by: zebullax <[email protected]>

Augment UT

Signed-off-by: zebullax <[email protected]>

Factor in namespace when profiling apvalue

Signed-off-by: zebullax <[email protected]>

Clean up dumb dumb

Signed-off-by: zebullax <[email protected]>
zebullax added 3 commits July 10, 2025 19:47
Signed-off-by: zebullax <[email protected]>
Signed-off-by: zebullax <[email protected]>
Signed-off-by: zebullax <[email protected]>
zebullax added 11 commits July 20, 2025 10:21
* Return null reflection for non-reflectable attributes

Signed-off-by: zebullax <[email protected]>

* Clean up UT

Signed-off-by: zebullax <[email protected]>

Filter out attributes that are not reflectable in attributes_of

Signed-off-by: zebullax <[email protected]>

Validate that unsupported attributes are not returned in attributes_of

Signed-off-by: zebullax <[email protected]>

---------

Signed-off-by: zebullax <[email protected]>
Allow attribute reflection expression in lambda body

Signed-off-by: zebullax <[email protected]>
* Add scaffolding to stash from data_member_spec then tag attributes in define_aggregate

Signed-off-by: zebullax <[email protected]>

* Switch to an Henry based approach without stashing callback to tag attributes

Signed-off-by: zebullax <[email protected]>

---------

Signed-off-by: zebullax <[email protected]>
* Turn Expr into strings for profiling purposes

Signed-off-by: zebullax <[email protected]>

* Add a low tiers profiling to ParsedAttr for expression arg

Signed-off-by: zebullax <[email protected]>

---------

Signed-off-by: zebullax <[email protected]>
Add hasAttribute

Add unproposed filtering on attribute namespace

Add variadic string like enum

Signed-off-by: zebullax <[email protected]>
Rename enum policy

Signed-off-by: zebullax <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant