This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,objc] avoid chainon when building record types in ObjC FE



On 2 Jul 2010, at 15:03, Nathan Froyd wrote:


The ObjC frontend builds of list of fields for record types with
repeated use of chainon:

 list = chainon (list, decl);
 list = chainon (list, decl);

This scheme does rather more work than it needs to. The patch below
addresses this by keeping a pointer to the last TREE_CHAIN field of the
list so we can append in constant time. I took the liberty of cleaning
up array type building, too.


We address a PR with this patch, too.  Hooray!  It only took us five
years... :)

yeah.. with ObjC it's not so much "low-hanging".. as "lying on the ground"... ;)



Tested on x86_64-unknown-linux-gnu. OK to commit?

I can't approve anything ...
... but I can say that it applied cleanly to i686-apple-darwin9 and x86_64-apple-darwin10 and without regressions.


dunno about any improvement in performance - the testsuite is dominated by short code .. so things that improve where long lists are involved are not so likely to to show -- perhaps someone should concoct a testcase for that,

... and thanks!
Iain


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]