Aldy Hernandez wrote: > So far the way I've envisioned (correct me if I'm wrong please), is to > add 2 entries to struct function: one for a hash table which will be > freed when we're done parsing the function, and one containing the > vector of used types.
I was hoping you could use a union of the two, to avoid adding two entries. > Problem number two... I'm apparently GTY clueless, and have been > unable to declare a vector of trees as a field of struct function. I always have a hard time with this too; I'm sorry, but I don't know the right incantation either. A simpler way to do this would be to just maintain a single global hash table of types-used-in-casts. I'm concerned that might result in writing out a lot of types you wouldn't otherwise need, because you'd be writing out types used in casts in functions that were themselves never written out. That might be particularly bad in C++; #include <kde.h> probably gives you a lot of such casts. You could combine the two ideas: a global hash table of types used in casts, where each entry had a list of functions using those types. That should take up no more storage than the per-function vectors. Then, you'd have to walk the entire hash table, writing out each type for which at least one of the associated functions was written out, including being inlined into another function. -- Mark Mitchell CodeSourcery [EMAIL PROTECTED] (650) 331-3385 x713