davidmalcolm / gcc-python-plugin

GCC plugin that embeds CPython inside the compiler
GNU General Public License v3.0
199 stars 58 forks source link

no way to look up a struct by tag #68

Open davidmalcolm opened 7 years ago

davidmalcolm commented 7 years ago

I could not find a way to look up a structure type by tag. E.g., I wanted to look up 'struct buffer'. I could do this by introducing typedefs, but I'd rather not have to do that.

davidmalcolm commented 7 years ago

Imported from trac issue 28. Created by tromey on 2012-01-08T15:58:28, last modified: 2012-01-10T11:37:38

davidmalcolm commented 7 years ago

Trac comment by dmalcolm on 2012-01-09 15:42:47:

(oops; added this to ticket #26 by mistake)

I added an example of extracting them in bd03e3b0845fa785330af3916f4253d505a9fa16

However, it looks like gcc.Block.vars is misnamed; it corresponds to: {{{

define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)

}}} from tree.h, but this seems to contain all declarations, not just variables (but see ticket #21).

I'm inclined to rename it to "decls" - does this sound sane?

davidmalcolm commented 7 years ago

Trac comment by tromey on 2012-01-10 11:37:38:

Thanks for adding the example.

I think renaming this attribute would be fine.