Hello All, After many tentative releases, I am proud to announce the MELT plugin 0.9.6-d release for GCC 4.6 and 4.7
MELT is a high-level domain specific language to extend GCC (with features like pattern matching to make that less difficult than thru GCC plugins hand-coded in C). You can download the gnuzipped tar source of MELT from http://gcc-melt.org/melt-0.9.6-d-plugin-for-gcc-4.6-or-4.7.tar.gz It is a gnu zipped source tar file of 5580021 bytes & md5sum 83ac70197a57968ed732d0f5442a3c2b extracted i from the MELT branch of GCC svn revision 190124 on August 03rd 2012. This MELT plugin release brings a feature which could interest every person curious about GCC internal representations (Gimple & Tree-s), even those not interested by the MELT domain specific language: the so called graphical probe. A screen shot is available on http://gcc-melt.org/ and you can get it directly from http://gcc-melt.org/melt-0.9.6d-probe-august-2012.png It shows you MELT and its probe in action when compiling the tree-ssanames.c file of GCC. On the left, two informational dialog windows show the GCC internal representation tied to a particular source location. On the right of the screen, the compiled source code is shown (with a tab for each source file). For each location interesting to GCC, a button (quite ugly) is given inside the source code, and you can push it to get informational dialog windows giving the GCC internal representation for that particular location. In a sense, this is probe dual to the GCC dump files, which show you all the internal representation after some given pass. The probe is coded in C++ using GtkMM for GTK 3.4 (you need at least that 3.4 version of Gtk, older Gtk versions have a naughty bug affecting the behavior of the probe). The probe inside MELT is sometimes buggy (on the GTK side); on some occasion, the GTK probe is looping (probably my misunderstanding of GTK, or maybe a GTK bug). I compile the probe with g++ -Wall -O -g $(pkg-config --cflags --libs gtksourceviewmm-3.0 gtkmm-3.0 gtk+-3.0) \ -o $HOME/bin/simplemelt-gtkmm-probe simplemelt-gtkmm-probe.cc and I added in my path a tiny shell script named "melt-probe" which has just #!/bin/sh exec simplemelt-gtkmm-probe -T $* # eof melt-probe script The -T argument to simplemelt-gtkmm-probe shows the trace window explaining the textual exchanges between MELT plugin and the probe binary. You can remove that argument if you want. The probe works thru a special mode of MELT. Once you have installed MELT (and manually installed the probe with melt-probe script), you can run gcc -fplugin=melt -fplugin-arg-melt-mode=probe -c yourfile.c (with of course other options, e.g. -O or -I...). The probe uses MELT functional abilities (closures are used to implement it), and the fact that MELT is compiled to C (textual requests coming from the probe gives a SIGIO, which is tested in a lot of places in the MELT generated C code). Now, some more specific MELT changes: ################################################################ NEWS for 0.9.6-d MELT plugin for GCC 4.6 & 4.7 [[august, 03rd 2012]] Language improvements ===================== Syntax: (USE-PACKAGE-FROM-PKG-CONFIG <packagename>) On systems, such as most Linux distributions, with the pkg-config utility http://en.wikipedia.org/wiki/Pkg-config http://pkg-config.freedesktop.org/ the given packagename is used when compiline the generated C code and when linking the generated shared module. Emited C code by MELT is more conformant to C++ and C coding standards. More primitives, macros, ... notably WHEN & UNLESS, like in Common Lisp... The CLASS_CONTAINER has been renamed as CLASS_REFERENCE. Likewise SET_CONTENT is renamed as SET_REFERENCE... Runtime improvements ==================== When a function is called in an occurrence expecting secondary results and does not return secondary results, a warning is emitted. MELT may emit symlinks to "unique" C files in the workdir, helpful when regenerating an already generated file... "Interrupts" have been inproperly named, speak of "signals" (in the Posix/Unix sense, not the Gtk/Qt one!). The build of the MELT runtime and of the MELT modules is done by an autogen-erated shell script melt-build-script.sh generated from melt-build-script.tpl & melt-build-script.def. It should be more robust, and avoid doing useless things, so is faster when you rebuild again MELT. Add support for timers & child processes... Debugging run works well with plugin using -fplugin-arg-melt-debugging=all (or =mode). Library improvment ================== The probe mode is able to to start and communicate an external graphical probe. A simple probe, coded in C++ for GTKmm3.4, is available as a self contained program simplemelt-gtkmm-probe.cc; its compilation command is given at the very end of that source file, e.g.: g++ -std=gnu++0x -Wall -O -g \ $(pkg-config --cflags --libs gtksourceviewmm-3.0 gtkmm-3.0 gtk+-3.0) \ -o $HOME/bin/simplemelt-gtkmm-probe simplemelt-gtkmm-probe.cc The probe code in simplemelt-gtkmm-probe.cc is still buggy. Sometimes, the probe windows freeze and you have to kill the process. You could have the following shell script, named melt-probe #! /bin/bash -x # the -T argument to the probe display the trace window # showing the exchanges between probe and MELT exec simplemelt-gtkmm-probe -T $* The probe mode is expecting a shell script or program named melt-probe somewhere in your path. You can now compile some C or C++ ... file with GCC enhanced by MELT, e.g. gcc -fplugin=melt -fplugin-arg-melt-mode=probe -c some-file.cc A graphical window appears, to display your source code some-file.cc (and others, e.g. included files). Click on the buttons inside it to show the corresponding GCC internals at the corresponding source location. Ability to walk on gimple sequences using GCC infrastructure thru walk_gimple_seq & walk_gimple_seq_unique_tree primitives. Much more interfaces to Gimple & Trees... The PPL (Parma Polyhedra Library) MELT binding is obsolete and will be soon removed (see http://bugseng.com/products/ppl/ for more about PPL, which is used in GCC-4.6 & GCC-4.7 for Graphite & Cloog, but won't be used in GCC 4.8). Hence, avoid e.g. having values of DISCR_PPL_CONSTRAINT_SYSTEM or using primitives or stuff of c-types like :ppl_coefficient etc... ################################################################ You can find more information, including tutorial slides, some (incomplete) documentation and examples on MELT web site http://gcc-melt.org/ I'm taking holidays from today evening (august 3rd 2012) till august 27th 2012, probably without any Internet access. A big thanks to Emmanuel Haucourt, Alexandre Lissy, Pierre Vittet for their help for this 0.9.6-d release of MELT plugin for GCC 4.6 & 4.7. Please report bugs about MELT and questions (and perhaps success stories) on gcc-m...@googlegroups.com Regards. NB: Any previous 0.9.6 something release of MELT should not be used. (release candidates and release 0.9.6.c was buggy). Use 0.9.6-d only. -- 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 mines, sont seulement les miennes} ***