On Wed, 18 May 2011 21:04:39 +0200 Pierre Vittet <pier...@pvittet.com> wrote:
> Hello, > > I have written a patch to allow the use of the GCC dominance functions > into MELT. [...] > Changelog: > 2011-05-17 Pierre Vittet <pier...@pvittet.com> > > * melt/xtramelt-ana-base.melt > (is_dominance_info_available, is_post_dominance_info_available, > calculate_dominance_info_unsafe, > calculate_post_dominance_info_unsafe, > free_dominance_info, free_post_dominance_info, > calculate_dominance_info, > calculate_post_dominance_info, debug_dominance_info, > debug_post_dominance_info, get_immediate_dominator_unsafe, > get_immediate_dominator, get_immediate_post_dominator_unsafe, > get_immediate_post_dominator, dominated_by_other_unsafe, > dominated_by_other, post_dominated_by_other_unsafe, > post_dominated_by_other, foreach_dominated_unsafe, > dominated_by_bb_iterator): Add primitives, functions, iterators for > using dominance info. > > Thanks for the patch. Some minor tweaks: First, put a space between formal arguments list & function name. So +(defprimitive calculate_dominance_info_unsafe() :void should be +(defprimitive calculate_dominance_info_unsafe () :void Then, please put the defined name on the same line that defprimitive or defun or def... When consecutive MELT formals have the same ctype, you don't need to repeat it So +(defprimitive + dominated_by_other_unsafe(:basic_block bbA :basic_block bbB) :long should be +(defprimitive dominated_by_other_unsafe (:basic_block bbA bbB) :long In :doc strings, document when something is a boxed value (distinction between values & stuffs is crucial), so write instead [I added the boxed word, it is important] +(defun get_immediate_dominator (bb) + :doc#{Return the next immediate dominator of the boxed basic_block $BB as a MELT +value.}# At last, all debug* operations should only output debug to stderr only when flag_melt_debug is set and give the MELT source position (because we don't want any debug printing in the usual case when -fmelt-debug is not given to our cc1) Look at debugloop in xtramelt-ana-base.melt for an example (notice that debugeprintfnonl is a C macro printing the MELT source position. So please resubmit a slightly improved patch. Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mine, sont seulement les miennes} ***