plugin: modify attribute arguments inside plugin

Klemen Jan Enova klemen.jan.enova@gmail.com
Sat Aug 2 08:25:00 GMT 2014


I would like to code a plugin, that would count the number of accesses 
to a field of some C struct.
That struct would be marked with __attribute__((access_count)). When 
handling that attribute, I
would like to assign an index to it (as an attribute argument), so that 
I can update the proper
element of my counter array, when there is a COMPONENT_REF with a marked 
struct as the target.

But attribute arguments are normally passed by the user, can the plugin 
change them, and how?
Juts checking that argument would be simpler and faster than looking for 
the target's name
(in a hashtable, or just an ordered array if there aren't going to be so 
many tracked structs)
and getting an index from that.



More information about the Gcc-help mailing list