Skip to content

Conversation

@fosterbrereton
Copy link
Contributor

When is a blockN not a blockN? When it's attribute class says otherwise :eyeroll:

Section 7, Figure 20 of the DWARF4 spec is a table giving a set of attributes and the possible ways the data they contain may be evaluated. For example, even if a DW_AT_vtable_elem_location attribute stores its values as a block1 form, the value is actually an exprloc, and should be evaluated as such.

This PR adds a layer of indirection around the evaluation of blockN forms, looking up the attribute class and performing the "right" evaluation as necessary. I say "right" because we only really do the right thing for constant and exprloc evaluations. Everything else is interpreted as a constant, for better or worse. When we find real-world values of the alternate classes that break ORC, we should address them.

Copy link
Contributor

@leethomason leethomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. DWARF is complex.

@fosterbrereton fosterbrereton merged commit d5552d0 into main Feb 8, 2024
@fosterbrereton fosterbrereton deleted the fosterbrereton/attribute-class-evaluation branch February 8, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants