PATCH RFC: stdio optimization [take 2]

Kaveh R. Ghazi
Tue Jan 4 12:17:00 GMT 2000

 > From: Jeffrey A Law <>
 >   > 2.  IMO, there are too many wrappers in stdio-opt.h.  I needed these
 >   > to maintain the return value and signature of each function so I
 >   > wouldn't have to jump through too many hoops to make a replacement.
 >   > Suggestions (and instructions) for reducing the number would be great.
 >   > 
 >   > E.g. I could elimintate those only needed for the return value if I
 >   > could detect when the return value was not used and punt in those
 >   > cases.  But I don't know how to detect that.  I could also use some
 >   > help on how to build arglists with different argument types.  E.g.
 >   > given a constant string parameter, how do I take string[0] and
 >   > transform it into a char/int in a function call in a language
 >   > independent manner?
 > Presumably the string[0]->char/int transformation is also happening at the
 > tree level?  If so, extract the relevent char out of the string and
 > build up a new tree constant.  You might write a hunk of C code which does
 > something similar and look at the tree nodes that get generated.

Okay, I poked around a bit and I'm having some success doing this:

 > newparm = build_int_2 (TREE_STRING_POINTER (stripped_string)[0], 0);
 > TREE_VALUE (arglist) = newparm;

Am I on the right track?

Kaveh R. Ghazi			Engagement Manager / Project Services		Qwest Internet Solutions

More information about the Gcc-patches mailing list