{"id":18253579,"url":"https://github.com/krk/gcc-melt","last_synced_at":"2025-04-08T21:34:19.970Z","repository":{"id":11598150,"uuid":"14090032","full_name":"krk/gcc-melt","owner":"krk","description":"unofficial mirror of http://gcc-melt.org/ melt","archived":false,"fork":false,"pushed_at":"2013-11-03T17:59:44.000Z","size":6332,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T16:56:54.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krk.png","metadata":{"files":{"readme":"README-MELT-PLUGIN","changelog":null,"contributing":null,"funding":null,"license":"COPYING3","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-03T17:53:03.000Z","updated_at":"2023-12-13T13:21:04.000Z","dependencies_parsed_at":"2022-09-19T11:40:49.895Z","dependency_job_id":null,"html_url":"https://github.com/krk/gcc-melt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2Fgcc-melt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2Fgcc-melt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2Fgcc-melt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krk%2Fgcc-melt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krk","download_url":"https://codeload.github.com/krk/gcc-melt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247933831,"owners_count":21020698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T10:07:20.661Z","updated_at":"2025-04-08T21:34:19.952Z","avatar_url":"https://github.com/krk.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Short installation instructions for MELT as a plugin to an installed\ngcc-4.7 or gcc-4.8 (or future gcc-4.9) enabled for plugins.\n\nSee also http://gcc-melt.org/\n\nMELT is a plugin and domain specific language for extending GCC (the\nGnu Compiler Collection), free software GPLv3+ licensed, FSF\ncopyrighted. MELT is a lispy, high-level, language providing pattern\nmatching and enabling functional/applicative/reflective programming\nstyles, to ease development of GCC extensions.  MELT is translated to\nC code (and the MELT translator is implemented in MELT).\n\nIf installing MELT as plugin to some existing gcc-4.7 installation\ntree, with the support of plugins enabled (or replace 4.7 by 4.8 if\nrelevant):\n\n\n################ quick steps for Debian/Unstable or Ubuntu or derived distributions ####\n\n## Run as root (e.g. with sudo):\n  apt-get install gcc-4.7 g++-4.7 make texinfo texi2html autogen gawk\n  apt-get build-dep gcc-4.7\n  apt-get install libppl-dev libppl-c-dev gcc-4.7-plugin-dev \n\n## then retrieve the MELT plugin release, and cd into it, then\n  make all\n  make install DESTDIR=/tmp/meltinstall\n\n## You might explicit the compiler you want to extend and to use:\n  make all CC=/usr/bin/gcc-4.7 CXX=/usr/bin/g++-4.7\n  make install CC=/usr/bin/gcc-4.7 CXX=/usr/bin/g++-4.7 DESTDIR=/tmp/meltinstall\n\n## The first \"make all\" needs 15 minutes, less than 1Gb disk, 4Gb RAM, and\n## *cannot be* a parallel \"make -j all\"\n\n## finally, as root copy the destination to install MELT\n  cp -v -p -R /tmp/meltinstall/. /.\n\n## Since MELT may generate and compile C code on the fly, you'll need its build\n## dependencies even to run it..\n\n## You need to rebuild \u0026 reinstall MELT even for minor GCC release\n##   upgrades (ie. from GCC 4.7.2 to 4.7.3).\n\n\n#########################################################################\n################################################################ DETAILS\n\n################ step 1\n\nFirst, ensure that 4.7 or 4.8 is correctly installed and has been built\nwith plugins enabled, for example (on a Debian Unstable, package gcc-4.8):\n\n % gcc-4.8 -v\nUsing built-in specs.\nCOLLECT_GCC=gcc\nCOLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper\nTarget: x86_64-linux-gnu\nConfigured with: ../src/configure -v --with-pkgversion='Debian 4.8.1-3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu\nThread model: posix\ngcc version 4.8.1 (Debian 4.8.1-3) \n\nBe sure that you have all the development packages for all libraries\nused by GCC (e.g. run 'apt-get build-dep gcc' on Debian). In\nparticular, you'll need the headers of CLOOG, PPL, MPC, MPFR, GMP\nlibraries.\n\nEnsure that your system have recent autogen, GNU make, gawk (GNU awk), texinfo,\ntexi2html utilities\n\n################ step 2\n\nThen, be sure that the GCC plugin development support has been\ninstalled. (On Debian, you'll need e.g. the gcc-4.8-plugin-dev package).\n\nSo you should have something like\n% gcc-4.8 -print-file-name=plugin \n/usr/lib/gcc/x86_64-linux-gnu/4.8/plugin\n\nBe sure that this plugin subdirectory is populated correctly since it\ncontains an include directory and probably a gengtype executable (and\nperhaps more, e.g. your previous installation of MELT).\n\n% ls -l $(gcc-4.8 -print-file-name=plugin)\n-rwxr-xr-x 1 root     root      172160 Sep  5 00:01 gengtype\n-rw-r--r-- 1 root     root      554675 Sep  4 23:47 gtype.state\ndrwxr-xr-x 9 root     root       20480 Sep 11 09:24 include\n\n\nNota Bene: the gtype.state and gengtype files might perhaps be elsewhere.\n\nBe sure that this include subdirectory contains meaningful files for\nGCC, like those for GIMPLE\n% ls -l $(gcc-4.8 -print-file-name=plugin)/include/gimple.* \n-rw-r--r-- 1 root root  14409 Sep  4 23:48 /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/gimple.def\n-rw-r--r-- 1 root root 134641 Sep  4 23:48 /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/gimple.h\n-rw-r--r-- 1 root root   1368 Sep  4 23:48 /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/include/gimple-pretty-print.h\n\n\nBe sure that the gengtype executable and its gtype.state textual data\nfile is available somewhere. On Debian/Sid the package\ngcc-4.8-plugin-dev provides them\n\nIf you have some previous MELT related files and directories it is\npreferable but not necessary to remove them. You might have two different\nreleases of MELT for the same compiler but we don't recommend doing that.\n\nrm -rf $(gcc-4.8 -print-file-name=plugin)/*melt*\n\n\nLook with an editor, or just with the head command, that this gtype.state\nfile is indeed the one related to your gcc-4.8:\n% head /usr/lib/gcc/x86_64-linux-gnu/4.8/plugin/gtype.state\n;;;;@@@@ GCC gengtype state\n;;; DON'T EDIT THIS FILE, since generated by GCC's gengtype\n;;; The format of this file is tied to a particular version of GCC.\n;;; Don't parse this file wihout knowing GCC gengtype internals.\n;;; This file should be parsed by the same gengtype which wrote it.\n\n(!version  \"4.8.1\")\n\n(!srcdir  \"../../src/gcc\")\n\n\n\n\n\n################ step 3\n\nYour plugin MELT directory should contain a Makefile which is a\nsymlink to a MELT-Plugin-Makefile file. Please look into that file.\n(Most of the work is done in melt-build.mk, included from it).\n\nUse\n    make all\nto build the MELT plugin which takes some time (15 minutes), because MELT is\nretranslating itself. It cannot be a parallel make -j\n\nUse\n   make install DESTDIR=/tmp/meltinstall\nto install the MELT plugin. The usual DESTDIR behave as expected.\nAs root, copy it appropriately:\n\n   cp -v -R -p /tmp/meltinstall/. /.\n\nActually, only /usr is affected on many Linux distributions,\nso that could have been \n\n   cp -v -R -p /tmp/meltinstall/usr/. /usr/.\n\n\n#### uninstallation\n\nSince all MELT related files are installed under \n$(gcc-4.8 -print-file-name=plugin) you can just do as root\n   rm -v -r -f $(gcc-4.8 -print-file-name=plugin)/*melt*\n\nto uninstall MELT\n\n\n########## For packagers\nNotice that the MELT plugin should be entirely rebuilt\neven for small changes of the compiler (e.g. when upgrading gcc from\n4.8.1 to 4.8.2).\n\n\n\n################\n\nTo prepare a source tree of the MELT plugin from the GCC MELT branch,\nrun contrib/gcc_update then read and run\ncontrib/make-melt-source-tar.sh from the GCC MELT branch. For\ninstance, I am running it with something similar to\n\n   /usr/src/Lang/gcc-melt-branch/contrib/make-melt-source-tar.sh \\\n       /usr/src/Lang/gcc-melt-branch \\\n       /tmp/gcc-melt-plugin \n\nIf all goes well, you get a /tmp/gcc-melt-plugin.tgz gnuzipped tar\narchive for the MELT plugin. This is only needed to people making a\nnew MELT plugin source archive.\n\n\n################ \n\nComments about the MELT plugin (including its installation script) are\nwelcome by email to \u003cbasile@starynkevitch.net\u003e [please mention MELT in\nthe subject line] and to \u003cgcc-melt@googlegroups.com\u003e\n\n\n\n\n\n\n################################################################\nNEWS for 1.0 MELT plugin for GCC 4.7 \u0026 4.8 [and future 4.9?]\n[[october 29th, 2013]]\n\nThis is a major release (with perhaps some small incompatibilities\nwith previous MELT plugin releases). A lot of new features are\nappearing. Much more ability to mix arbitrary C/C++ \u0026 MELT code in any\nway, and lots of new features both inside the MELT language and the\nMELT plugin, even for newbies. Some modes are now available and could\nbe useful even without understanding much of the MELT domain specific\nlanguage.\n\nMELT 1.0 is usable with GCC 4.7 and 4.8 but not usable with GCC 4.6 or\nearlier, because it requires a GCC compiler written in C++ and because\nit is generating C++ code.\n\n   End-user improvements\n   =====================\n\n **** \n * Several MELT modes are usable without real knowledge of the MELT\n   domain specific language, notably -fplugin-arg-melt-mode=findgimple\n   (to find all gimples matching some given gimple pattern in all\n   functions whose declaration matches a given tree pattern) and\n   -fplugin-arg-melt-mode=justcountipa (to count gimples and basic\n   blocks at the Inter-Procedural Analysis stage).\n\n   Several examples of MELT modes are given in \n   http://gcc-melt.org/tutousemelt.html\n\n   It is notably possible to \n\n     + find all calls to malloc with a constant size greater than 100\n       that size could have been given thru sizeof and/or some\n       constant expressions...\n\n     + find all calls to printf with a format string containing the\n       word current and more than 6 arguments inside functions whose\n       name start with foo\n\n     + etc....\n \n\n   These exploring modes have to work inside the compiler. A textual\n   approach won't work. So these exploring modes should interest a\n   large number of GCC users.\n\n ***\n * When verbose, all the successful modes are displayed.\n\n   Language improvements\n   =====================\n\n ***\n * It is possible to define macros with defmacro (taking four\n  arguments: the s-expression to be macro-expanded, the environment,\n  the macro-expander function, the module context). Such macros can be\n  used in the same MELT module defining them, but should expand to a \n  source AST which you would be able to read...\n\n ***\n * It is possible to define locally bound macros with the :macro annotation\n in let bindings.\n\n *** \n * at_macro_expansion macro can be used to define functions (and\n  instances, etc...) used only at macro-expansion time of further\n  defmacro-defined macros.\n\n ***\n * Macros defined by defmacro and definition given inside at_macro_expansion \n are evaluated in a separate environment so don't see the ordinary bindings \n currently defined in the MELT source.\n\n ***\n * The comma operator, only usefine inside anti-quotations (thru\n  backquote) is expanded to a sequence of sub-expressions if the\n  anti-quotation gives a sequence, i.e. a tuple or a list. So no\n  comma-at operator is needed.\n\n ***\n * quotes, anti-quotes (with backquote), and comma operators are\n possible even on arbitrary s-expressions. But quotations and\n antiquotations of s-exprs have their location slightly less precise\n (only file name and line number, but not column number, are\n preserved)\n\n   Runtime improvements\n   ====================\n\n  *** \n  * The debug macro accepts debug manipulator which alters the way\n   the next argument is debug-printed, e.g. \n       (DEBUG \"here smaller debug of x=\" DEBUG_LESS x)\n\n  ***\n  * The variadic ERROR_AT WARNING_AT and INFORM_AT functions are available\n  for diagnostics. They take a format string with occurrences of $1 ... $9 \n  expanded into variadic arguments. For example\n       (ERRROR_AT somelocation \"this is an error with number $1 and tree $2\"\n                  somenumber sometree)\n  The location can be null, or be given by some boxed gimple or boxed tree.\n\n  *** \n  * The ASSERT_MSG macro can have more arguments, which are shown\n  when the assertion fails.\n\n  ***\n  * MELT registered passes have a unique number (for GCC 4.9).\n\n  ***\n  * The runtime is named melt-runtime.cc since it is C++ code. \n\n  ***\n  * MELT generated frames are classy because they are C++ classes.\n\n As usual, many bug fixes... A ticket system is now available on\n https://sourceforge.net/p/gcc-melt/tickets/ for bug reports.\n\n################################################################\nNEWS for 0.9.9 MELT plugin for GCC 4.6 \u0026 4.7 \u0026 4.8\n[[june, 22nd, 2013]]\n\nThis is a significant release. A lot of new features are\nappearing. Much more ability to mix arbitrary C/C++ \u0026 MELT code in any\nway and both directions!\n\nThis is the last MELT release supporting GCC 4.6 and GCC compilers in\nC only. Future MELT releases with will be C++ only (i.e. emit C++\ncode), for GCC 4.7 \u0026 4.8\n\n   Language improvements\n   =====================\n\n   ***\n   * Code chunks can contain void side-effecting expressions of :VOID\n     ctype, translated to some C/C++ block. Hence code chunks can even\n     be indirectly nested. Within the macro-string, write $(...) for\n     the expression. You may want to make it a PROGN ending with\n     (VOID) to force it to be void.  Sub-expressions -of :VOID ctype-\n     inside code chunks are evaluated at the place of appearance, and\n     are expanded to C/C++ blocks at their occurrence.\n\n\n   ***\n   * Expression chunks are expanded into C/C++ expressions. Syntax is\n\n        (EXPR_CHUNK \u003cstate-symbol\u003e \u003cctype\u003e \u003cmacro-string\u003e ...)\n\n   For instance, to get the pid of the cc1 running your MELT extension, use\n      (expr_chunk getpid_chk :long #{/*$GETPID_CHK*/ (long)getpid()}#)\n\n   Important notice: any sub-expression appearing in some EXPR_CHUNK\n   is evaluated before, like for primitives, so will always be\n   evaluated.\n\n\n   ***\n   * Ability to emit some C code in the implementation part. Syntax\n     (CIMPLEMENT \u003ccode-string\u003e)\n\n   This is a companion to the existing CHEADER. Useful to declare some\n   specific non-inlined C++ function or static variable with CHEADER\n   and to define it with CIMPLEMENT.\n\n\n\n   ***\n   * New ability to add module \"static\" value variables in MELT\n   \n        (DEFVAR \u003cvarname\u003e)\n   \n   The so defined variable \u003cvarname\u003e is (in the generated C/C++ code)\n   a pointer [to some MELT value] inside a static array. Garbage\n   collection support is generated.  The variable \u003cvarname\u003e cannot be\n   exported with EXPORT_VALUES, you need to export functions accessing\n   or changing it.  Once defined, you can use SETQ to assign to such a\n   module variable (and also DEFHOOK with :VAR)\n\n\n   ***\n   * New ability to define hooks, that is C/C++ functions coded in\n     MELT. Syntax is \n\n        (DEFHOOK \u003chookname\u003e \u003cinput-formals\u003e \u003coutput-formals\u003e \u003cctype\u003e \n                 [:var \u003cmodule-variable\u003e] \u003cbody...\u003e)\n     \n    The optional \u003cmodule-variable\u003e given with a :var annotation should be \n    a module variable previously defined with DEFVAR. \n    For example, with the following code\n\n        (defvar varlist)\n        (setq varlist (list))\n        (defvar varhook)\n        (defhook appendnumhk (:long n) (:long outlen) :void \n                 :var varhook\n            (list_append varlist (constant_box n))\n            (setq outlen (list_length varlist)))\n\n    you get two generated extern \"C\" functions in the emitted C/C++ code\n            void melthook_APPENDNUMHK (melt_ptr_t hook, long n, long* outlen);\n    and\n            void melthookproc_APPENDNUMHK (long n, long* outlen);\n\n    which you could use e.g. in some other code_chunk-s. The first\n    function melthook_APPENDNUMHK needs the hook value `appendnumhk' as\n    its first argument; the second function melthookproc_APPENDNUMHK\n    is generated because a :var annotation has been given, and uses\n    the hook value automagically stored in that `varhook' module\n    variable.\n    \n    Many functions previously coded in C/C++ inside the melt-runtime.c\n    have been migrated to predefined hooks coded in MELT inside\n    melt/warmelt-hooks.melt etc...\n\n    Hooks are a very important addition: with them you can mix C/C++ \u0026 MELT code \n    at will.\n\n\n   ***\n   * New ability to call hooks,\n\n   Expresssions can also call known hooks given by their operator. But\n   the hook cannot be unknown: only applications can be done with\n   statically unknown operators.\n\n\n   ***\n   * EVAL function\n\n   An EVAL function has been added, it wraps the existing\n   TRANSLATE_RUN_MELT_EXPRESSIONS utility function so works by\n   generating C/C++ code then loading and running it.\n\n\n   Runtime improvements\n   ====================\n\n   *** \n   * To register your MELT pass, use the INSTALL_MELT_PASS_IN_GCC\n   function instead of the obsolete INSTALL_MELT_GCC_PASS\n   primitive. Notice that INSTALL_MELT_PASS_IN_GCC is incompatible\n   with the older INSTALL_MELT_GCC_PASS, because you need to pass\n   the :after keyword instead of the \"after\" cstring, etc, etc...\n\n\n   ***\n   * Many plugin events are interfaced (using hook machinery). \n   Some of them are incompatible with previous MELT releases.\n\n\n   ***\n   * Add macro melt_low_debug_value(Message,Value) to debug-print \n   some arbitrary MELT value in C/C++ code or chunk. \n   This goes thru a predefined hook, similar to the DEBUG macro of MELT.\n\n\n   *** \n   * Add C variable melt_plugin_name containing the name of the MELT\n   plugin, useful for using register_callback.\n\n\n   *** \n   * Raised default threshold for GC. The MELT full garbage\n   collector is less called.\n\n\n   ***\n   * Many bug fixes and internal improvements... Emitted C/C++ code \n     contains more checks.. REPL and EVAL modes are working much better.\n\n\n   ***\n   * More primitives and functions\n   \n\n\n################################################################\nNEWS for 0.9.8 MELT plugin for GCC 4.6 \u0026 4.7 \u0026 future 4.8\n[[december, 22th, 2012]]\n\n   Language improvements\n   =====================\n\n   * The LET syntax accepts bindings with the :auto ctype-annotation, like e.g.\n\n       (let ( (:auto four (+i 2 2)) )\n        (debug \"four=\" four))\n\n   the ctype is the obtained by the expression defining that binding \n   i.e.   (+i 2 2) it the above example which is of ctype_long. \n\n   The default ctype annotation -which used to be :value- is now :auto\n   this change is upward compatible but is very significant.\n\n   \n   * BOX-ing and CONSTANT_BOX-ing syntactic constructs\n\n   The (BOX \u003cstuff\u003e) syntax makes a mutable value boxing the given\n   stuff. So for example (BOX (+i 2 1)) is the same \n   as (MAKE_INTEGERBOX DISCR_INTEGER (+i 2 1))\n\n   The (CONSTANT_BOX \u003cstuff\u003e) syntax makes a constant value boxing the \n   given stuff. So for example (CONSTANT_BOX 1) is the same as\n   the expression (MAKE_INTEGERBOX DISCR_CONSTANT_INTEGER 1)\n\n   * UNBOX-ing syntactic construct\n   \n   The (UNBOX \u003cctype\u003e \u003cvalue\u003e) is a convenient way to unbox values. For example\n   the expression (UNBOX :TREE V) is the same as (TREE_CONTENT V)\n\n\n   Runtime improvements\n   ====================\n\n   A new evalfile mode is available to evaluate expressions from a\n   file (default is standard input).\n\n   The evaluating modes are diplaying the last evaluated expression\n   using the debug depth parameter, which can be set with\n   -fplugin-arg-melt-debug-depth=10 program argument.\n\n   C-types have now autoboxing fields. Discriminants for constant\n   boxing of stuff have been added, notably\n   DISCR_CONSTANT_BASIC_BLOCK, DISCR_CONSTANT_EDGE,\n   DISCR_CONSTANT_GIMPLE, DISCR_CONSTANT_GIMPLE_SEQ,\n   DISCR_CONSTANT_LOOP, DISCR_CONSTANT_TREE\n\n   Vector from GCC 4.8 are now possible inside MELT.\n\n   A melt_intern_cstring function is available in C to intern\n   arbitrary null-terminated strings.\n\n   The melt-module.mk makefile is accepting the\n   GCCMELT_MODULE_VERBOSE_BUILD variable.\n\n   Several primitives have been added.\n\n   * Numerous bug fixes. \n\n################################################################\nNEWS for 0.9.7 MELT plugin for GCC 4.6 \u0026 4.7 \u0026 future 4.8\n[[october, 10th, 2012]]\n\n   Language improvement\n   ====================\n\n When creating an instance with definstance or instance, the\n translator checks that fields are filled with values. Previous\n versions of MELT could crash in that case.\n\n (CHEADER ...) constructs are working as documented.\n\n The Parma Polyhedra Library is removed from MELT.\n\n String values know their length, so safe access to some byte inside\n is possible.\n\n   Added a lot of cmatchers (and implicit primitives) like\n\ttree_boolean_false_node, tree_boolean_true_node,\n\ttree_boolean_type_node, tree_char_type_node,\n\ttree_const_ptr_type_node, tree_double_type_node,\n\ttree_float_type_node, tree_int128_integer_type_node,\n\ttree_int128_unsigned_type_node, tree_integer_minus_one_node,\n\ttree_integer_one_node, tree_integer_type_node,\n\ttree_integer_zero_node, tree_long_double_type_node,\n\ttree_long_integer_type_node, tree_long_long_integer_type_node,\n\ttree_long_long_unsigned_type_node,\n\ttree_long_unsigned_type_node, tree_null_pointer_node,\n\ttree_ptr_type_node, tree_short_integer_type_node,\n\ttree_short_unsigned_type_node, tree_signed_char_type_node,\n\ttree_size_type_node, tree_unsigned_char_type_node,\n\ttree_unsigned_type_node, tree_void_type_node\n   to access the very built-in trees known to GCC.\n   Added more tree \u0026 gimple related matchers and primitives.\n\n Less spurious warnings when building MELT.\n\n\n   Runtime improvements\n   ====================\n\n  Add a runtime expression evaluation function\n  TRANSLATE_RUN_MELT_EXPRESSIONS with a mode eval for initial\n  evaluation of a sequence of expressions, and a mode repl for\n  read-eval-print-loop, and a mode eval for evaluating and printing a\n  given expression. Try e.g. \n     gcc -c -fplugin=melt  -fplugin-arg-melt-mode=eval \\\n        -fplugin-arg-melt-arg='(list discr_tree class_sexpr)' \\\n        empty.c\n\n\n  Advanced users could register their own finalized client data using\n  the melt_payload_register_descriptor C function.\n\n  The building procedure has been revamped. Advanced users could\n  define their GCCMELT_BUILD_NOTIFICATION environment variable to\n  e.g. a script meltbuild-notification like\n\n      #! /bin/bash\n      # first arg title, second arg message\n      if [ \"$DISPLAY\" = \":0.0\" -a -n \"$DESKTOP_SESSION\" -a $(which notify-send) ]; then\n         notify-send -t 3500 -i info \"MELT BUILD: $1\" \"$2\"\n      else\n         logger -t meltbuild -p user.info \"$1=\" \"$2\"\n      fi\n\n  and they will have a nice bubble notification under most Linux\n  desktops of the major steps of the build. The building procedure is\n  now quicker than before.\n\n  Advanved MELT users can set their MELTGCC_NO_CHECK_RUNTIME to\n  disable checking of the MELT runtime. This is notably needed when\n  the MELT plugin is compiled for a cross compiler.\n\n  Advanced MELT users willing to debug with gdb could set the\n  melt_alptr_1 and melt_objhash_1 in their gdb debugger to track\n  allocation or changes of MELT values or objects.\n\n  The -fmelt-debugging=all option works as expected in the MELT branch\n  and so does -fplugin-arg-melt-debugging=all in the MELT plugin.\n\n\nNumerous bug fixes. The probe has been improved, and also shows some\nGimple/SSA. Consider using Alexandre Lissy's replacement (Python/Qt\nbased) of the probe.\n\n\n\n\n\n ################################################################\n NEWS for 0.9.6 MELT plugin for GCC 4.6 \u0026 4.7 [[july, 31st 2012]]\n\n   Language improvements\n   =====================\n\n   Syntax: (USE-PACKAGE-FROM-PKG-CONFIG \u003cpackagename\u003e)\n\n   On systems, such as most Linux distributions, with the pkg-config\n   utility http://en.wikipedia.org/wiki/Pkg-config\n   http://pkg-config.freedesktop.org/ the given packagename is used\n   when compiline the generated C code and when linking the generated\n   shared module.\n\n   Emited C code by MELT is more conformant to C++ and C coding standards.\n\n   More primitives, macros, ... notably WHEN \u0026 UNLESS, like in Common Lisp...\n\n   The CLASS_CONTAINER has been renamed as CLASS_REFERENCE. Likewise\n   SET_CONTENT is renamed as SET_REFERENCE...\n\n\n   Runtime improvements\n   ====================\n\n   When a function is called in an occurrence expecting secondary\n   results and does not return secondary results, a warning is\n   emitted.\n\n   MELT may emit symlinks to \"unique\" C files in the workdir, helpful\n   when regenerating an already generated file...\n\n   \"Interrupts\" have been inproperly named, speak of \"signals\" (in the\n   Posix/Unix sense, not the Gtk/Qt one!).\n\n   The build of the MELT runtime and of the MELT modules is done by an\n   autogen-erated shell script melt-build-script.sh generated from\n   melt-build-script.tpl \u0026 melt-build-script.def. It should be more\n   robust, and avoid doing useless things, so is faster when you\n   rebuild again MELT.\n\n   Add support for timers \u0026 child processes...\n\n   Debugging run works well with plugin using\n   -fplugin-arg-melt-debugging=all (or =mode).\n\n   Library improvment\n   ==================\n\n   The probe mode is able to to start and communicate an external\n   graphical probe.\n\n   A simple probe, coded in C++ for GTKmm3.4, is available as a self\n   contained program simplemelt-gtkmm-probe.cc; its compilation\n   command is given at the very end of that source file, e.g.:\n\n        g++ -std=gnu++0x -Wall -O -g \\\n          $(pkg-config --cflags --libs gtksourceviewmm-3.0  gtkmm-3.0  gtk+-3.0) \\\n        -o $HOME/bin/simplemelt-gtkmm-probe simplemelt-gtkmm-probe.cc\n\n   The probe code in simplemelt-gtkmm-probe.cc is still buggy. \n   Sometimes, the probe windows freeze and you have to kill the process.\n\n   You could have the following shell script, named melt-probe\n                     \n     #! /bin/bash -x\n     # the -T argument to the probe display the trace window \n     # showing the exchanges between probe and MELT\n     exec simplemelt-gtkmm-probe -T $*\n\n   The probe mode is expecting a shell script or program named\n   melt-probe somewhere in your path.\n\n   You can now compile some C or C++ ... file with GCC enhanced by MELT, e.g.\n     gcc -fplugin=melt -fplugin-arg-melt-mode=probe -c some-file.cc\n\n   A graphical window appears, to display your source code\n   some-file.cc (and others, e.g. included files). Click on the\n   buttons inside it to show the corresponding GCC internals at the\n   corresponding source location.\n\n   Ability to walk on gimple sequences using GCC infrastructure thru\n   walk_gimple_seq \u0026 walk_gimple_seq_unique_tree primitives.\n\n   Much more interfaces to Gimple \u0026 Trees...\n\n   The PPL (Parma Polyhedra Library) MELT binding is obsolete and will\nbe soon removed (see http://bugseng.com/products/ppl/ for more about\nPPL, which is used in GCC-4.6 \u0026 GCC-4.7 for Graphite \u0026 Cloog, but won't\nbe used in GCC 4.8). Hence, avoid e.g. having values of\nDISCR_PPL_CONSTRAINT_SYSTEM or using primitives or stuff of c-types\nlike :ppl_coefficient etc...\n\n################################################################ NEWS\nfor 0.9.5 MELT plugin for GCC 4.6 \u0026 4.7 [[April 12th 2012]]\n\n   Language improvements\n   =====================\n\n   Alternative infix syntax is abandoned (it was never implemented)\n\n   Accept $(sub sepxr) in macro-string and $[seq sepxr]\n\n   Runtime improvements\n   ====================\n\n   Handle SIGIO Unix signals with asynchronous input channels\n   (experimental feature)\n\n   Can be compiled by C++ (since GCC 4.7 often is)\n\n   All the values are translated to melt_ptr_t variables, not void*\n   ones.\n\n   Library improvment\n   ==================\n\n   Much more matchers, and much more generated documentation, to interface to\n   GCC internal stuff in xtramelt-ana-base.melt\n   \n\n#######################################################################\nNEWS for 0.9.4.b MELT plugin for GCC 4.6 (and 4.7 when available)\nreleased on March 04th, 2012\n\n   Language improvements\n   =====================\n\nAdd CHEADER macro to insert header c-code. For example\n\n   (cheader #{#include \u003creadline/readline.h\u003e}#)\nor \n   (cheader #{inline int succ(int x) { return x+1;}}#)\n\n[you still need dirty tricks to link an external library into a MELT\nmodule; as a temporary workaround, consider editing melt-module.mk for\nthem, perhaps defining GCCMELT_MODULE_EXTRALIBES there, or link\nmanually the library into melt.so meta-plugin]\n\n   Runtime \n   =======\n\nHash maps have an auxiliary data value, which can be accessed and set\nat will. \n\n   Translator\n   ==========\n\nAll C-generating devices (primitives, c-iterators, ...) emit their\ncode in a syntax checking C function, which is never called, but is\nemitted to ensure the emittable C code is syntactically correct. This\ncatch typos in (defprimitive ...) etc... even for e.g. yet unused\nprimitives.\n\n   Bugs \n   ====\n\nMany bugs have been corrected.\n\n[Notably, the 0.9.4 release of march 02nd 2012, -not this 0.9.4.b-\ndidn't generate documentation correctly]\n\n\n#######################################################################\nNEWS for 0.9.3 MELT plugin for gcc-4.6 (and future gcc-4.7)\nJanuary 27th, 2012\n\nNew features:\n\n    Language improvements\n    =====================\n\nAbility to define a named value with the (DEFINE \u003cname\u003e \u003cexpr\u003e) construct\n\n   More support notably for Gimple \u0026 Tree\n   ======================================\nAdded more cmatchers etc.\n\n   Runtime improvement\n   ===================\n\nGeneration of timestamping C file foo+melttime.h included from\ngenerated descriptor file foo+meltdesc.c from foo.melt \n\n#######################################################################\nNEWS for 0.9.2.b MELT plugin for gcc-4.6 (and future gcc-4.7)\n\nDecember 08th, 2011: Release of MELT plugin 0.9.2 for gcc-4.6 (\u0026 future gcc-4.7)\n\tdedicated to the memory of John McCarthy\n        http://en.wikipedia.org/wiki/John_McCarthy_(computer_scientist)\n\nSeveral bug fixes.\n\nNew features:\n\n    cloning of values\n    =================\n\nThe CLONE_WITH_DISCRIMINANT primitive -whose implementation is mostly\ngenerated- enables creating new values, nearly clones of old\nones. Usage is\n\n    (clone_with_discriminant \u003cold-value\u003e \u003cnew-discriminant\u003e)\n\nIf the new discriminant is compatible with the old value's\ndiscriminant, a new value is allocated. If it is not compatible nor\nnot a discriminant, the old value is returned. In particular, it is\npossible to use \n   (clone_with_discriminant (lambda ....) discr_debug_closure) \nto make a debugging closure.\n\n   debugging closures \n   ==================\n\nThe DEBUG macro (and the underlying MELT_DEBUG_FUN which you should\nnot use directly) handles closure with the DISCR_DEBUG_CLOSURE\ndiscriminant specially (somehow like C++ manipulators for\nostream-s). If an argument is a debugging closure of exactly the\nDISCR_DEBUG_CLOSURE discriminant, the next argument is displayed using\nthat debugging closure.\n\n   Walking SSA use-def chains\n   ==========================\n\nThe primitives WALK_USE_DEF_CHAIN_BREADTH_FIRST \u0026\nWALK_USE_DEF_CHAIN_DEPTH_FIRST enables to walk thru the use-def chains\nin SSA passes.\n\n   More support notably for Gimple \u0026 Tree\n   ======================================\n\nSeveral functions, cmatchers, primitives have been defined, notably\nGIMPLE_ASSIGN_TO, WALK_USE_DEF_CHAIN_BREADTH_FIRST \u0026\nWALK_USE_DEF_CHAIN_DEPTH_FIRST, EACHGIMPLEPHI_IN_BASICBLOCK\n\n\n  New MELT hooks for PLUGIN_FINISH_TYPE \u0026 PLUGIN_FINISH_DECL\n  ==========================================================\n\nMELT functions can be registered using\nREGISTER_FINISH_TYPE_HOOK_FIRST, REGISTER_FINISH_TYPE_HOOK_LAST,\nREGISTER_FINISH_DECL_HOOK_FIRST, REGISTER_FINISH_DECL_HOOK_LAST. The\nargument is a boxed tree value. The PLUGIN_FINISH_DECL don't exist in\nGCC 4.6 (only in GCC 4.7 and later).\n\n  New MELT hooks for other events\n  ===============================\n \nMELT functions can be register for PLUGIN_ALL_PASSES_START,\n     PLUGIN_ALL_PASSES_END, PLUGIN_ALL_IPA_PASSES_START,\n     PLUGIN_ALL_IPA_PASSES_END, PLUGIN_EARLY_GIMPLE_PASSES_START,\n     PLUGIN_EARLY_GIMPLE_PASSES_END event using\n REGISTER_ALL_IPA_PASSES_END_HOOK_FIRST\n REGISTER_ALL_IPA_PASSES_END_HOOK_LAST\n REGISTER_ALL_IPA_PASSES_START_HOOK_FIRST\n REGISTER_ALL_IPA_PASSES_START_HOOK_LAST\n REGISTER_ALL_PASSES_END_HOOK_FIRST\n REGISTER_ALL_PASSES_END_HOOK_LAST\n REGISTER_ALL_PASSES_START_HOOK_FIRST\n REGISTER_ALL_PASSES_START_HOOK_LAST\n REGISTER_EARLY_GIMPLE_PASSES_END_HOOK_FIRST\n REGISTER_EARLY_GIMPLE_PASSES_END_HOOK_LAST\n REGISTER_EARLY_GIMPLE_PASSES_START_HOOK_FIRST\n REGISTER_EARLY_GIMPLE_PASSES_START_HOOK_LAST\n\n\n  More runtime code generated\n  ===========================\nMore runtime code is generated internally.\n\n  Additional translating MELT modes\n  =================================\n\nThe translatetomodule mode produces all three flavors (.quicklybuilt.so, .debugnoline.so, .optimized.so) of modules\n\nThe translateoptimized mode produces .optimized.so flavor of modules\n\n#######################################################################\nNEWS for 0.9.1 MELT plugin for gcc-4.6\n\nOctober 24, 2011: Release of MELT plugin 0.9.1 for gcc-4.6\n\tdedicated to the memory of Dennis M. Ritchie\n\thttp://en.wikipedia.org/wiki/Dennis_Ritchie\n\nNew features:\n\n    variadic MELT functions. \n    =======================\nA formal arguments list (i.e. formals for LAMBDA or DEFUN) ending with\n:REST is for variadic functions with a variable number and type of\narguments (so :REST in MELT is similar to the ellipsis ... notation in\nC prototypes).  At least one first formal argument should be provided\nand should be a value.\n\nThe (VARIADIC ....) macro is used to fetch actual variadic\narguments. A variadic cursor is internally maintained to parse the\nvariadic actual arguments. The VARIADIC macro has a sequence of\nvariadic cases. Each variadic case starts with an ordinary\n[non-variadic] formal arguments list, and has a body which is\nevaluated for side effects if the current arguments at the cursor\nposition fits into the formal. The last variadic case can also starts\nwith an :ELSE.  See also\nhttp://groups.google.com/group/gcc-melt/browse_thread/thread/c124ea6af940c08e\n\n    variadic (DEBUG ....) macro.\n    ============================\n\nDebugging messages should go thru the variadic (DEBUG ...) macro which\naccepts an arbitrary kind and number of arguments. The DEBUG_MSG macro\nis obsolete.\n\n   variadic ADD2OUT function\n   =========================\n\nThe ADD2OUT variadic function add to an output (either a file value;\nor a string buffer values) arbitrary things.\n\n#######################################################################\nNEWS for 0.9 MELT plugin for gcc-4.6\n\nSeptember 27th, 2011: Release of MELT plugin 0.9 for gcc-4.6\n\nNew features:\n\n    Documentation is generated\n\n    The PLUGIN_PRE_GENERICIZE event is interfaced.\n\n    The build machinery and the binary module loading has been\n    significantly updated.  Modules shared objects are like\n    warmelt-macro.3461497d8ef7239dc1f2f132623e6dd5.quicklybuilt.so and\n    they contain the md5sum of the catenation of all C files. They\n    also come in various flavor: quicklybuilt (the generated C is\n    compiled with -O0 -DMELT_HAVE_DEBUG), optimized (the generated C\n    is compiled with -01 and without -DMELT_HAVE_DEBUG), debugnoline\n    (the generated C is compiled with -g and -DMELT_HAVE_DEBUG but no\n    #line directives).\n\n    Conceptually, a module is loaded by loading its +meltdesc.c\n    file. That file (e.g. warmelt-macro+meltdesc.c corresponding to\n    warmelt-macro.melt) should never be moved or even edited.  It is\n    parsed at module load time, and contains the various md5sum of\n    real generated C files.\n\n    New option -fplugin-arg-melt-workdir= for the work directory,\n    where every .c or .so files are generated.\n\n    The DISCR_BOX discriminant has been removed. Use containers instead.\n\n    Containers, that is instances of class_container having one single field \n    :container_value, are supported by syntactic macros and sugar \u0026 function.\n       (container V)   \n          =equivalent=   (instance class_container :container_value V)\n       (content C)\n          =equivalent=   (get_field :container_value C)\n       (set_content C V)\n          =equivalent=   (put_fields C :container_value V)\n    You can write exclaim instead of content, and there is a new syntactic \n    sugar\n       !X\n\n     is the same as (content X) - the exclamation mark should be\n     followed by spaces, letters, or left parenthesis to be parsed as\n     exclaim -that is as the content macro above.\n\n    In patterns, ?(container ?v) means \n    ?(instance class_container :container_value ?v)\n\n    Fields can be accessed by their name, so\n      (:F C)\n   is the same as (get_field :F C)\n   Hence (:container_value foo) is the same as !foo or \n   (get_field :container_value foo)\n\n   Experimental syntactic sugar: inside an s-expr, a macro string\n   written ##{...}# is expanded as several components, not a single\n   list.\n\n   Experimental: ability to (define ...) values like in Scheme.\n\n   Ability to create gimple-s and to modify gimple_seq.\n\n   Slow boxed arithmetic operations are available (e.g. +iv gets two\n   boxed integer and gives the boxed integer of their sum).\n\nMany bug fixes.\n\nThe build system has been revamped. The generated .c files should be\navailable when running MELT.\n\n\nThanks to Pierre Vittet, Alexandre Lissy, Romain Geissler for\nfeedback, patches, suggestions.\n\n#######################################################################\nNEWS for 0.8 MELT plugin for gcc-4.6\n\nJuly 11th, 2011: Release of MELT plugin 0.8 for GCC 4.6\nas melt-0.8-plugin-for-gcc-4.6 on http://gcc-melt.org/\n\n\nNew features:\n * support for pragmas for MELT\n\n * the MELT garbage collector is called less often, using the\n   PLUGIN_GGC_START hook.\n\n * several new c-iterators and c-matchers.\n\n * added static analyzing pass gccframe, useful for melt-runtime.c\n\n * reject nested defun-s, you should use letrec or let...\n\n * the MELT plugin is built with its MELT-Plugin-Makefile\n\n * debug_msg, assert_msg ... should work, thanks to MELT_HAVE_DEBUG\n   preprocessor flag, even when melt.so is a plugin for a GCC without\n   checks enabled.\n\n * melt-runtime.h has a melt_gcc_version integer variable and\n   melt-runtime.c should be given MELT_GCC_VERSION preprocessor\n   constant.\n\n * runfile mode compiles quickly (with debug_msg support). Add new mode\n   translatequickly to compile quickly (with debug_msg \u0026 assert_msg\n   support).\n\n * the MELT building procedure builds various variants of MELT modules,\n\n   The 'optimized' variant is built with -O2 but don't support\n   (debug_msg ...)  or (assert_msg ...). The 'quicklybuilt' variant is\n   built with -O0 and supports debug_msg \u0026 assert_msg.  The\n   'debugnoline' variant is mostly useful with gdb, and also supports\n   debug_msg \u0026 assert_msg. These variants should be interoperable, you\n   could have a warmelt* module with 'optimized' variant and an\n   xtramelt* module in 'quicklybuilt' bariant.\n\nMany bugfixes\n  (but some bugs remain)\n\nThanks to Pierre Vittet for code contributions (notably thru Google\nSummer of Code), Alexandre Lissy and Allan McRae for bug reports.\n\n#######################################################################\nNEWS for 0.7 MELT plugin for gcc-4.6\n\nApril 29th, 2011: first release, melt-0.7-plugin-for-gcc-4.6\n\n################################################################\n(MELT development is partly funded thru OpenGPU [FUI call] \u0026 GlobalGCC\n[ITEA call] projects by French DGCIS).\n\n\n################################################################\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrk%2Fgcc-melt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrk%2Fgcc-melt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrk%2Fgcc-melt/lists"}