[M3commit] [modula3/cm3] 322694: Rework llvmbindings to circumvent ABI incompatibil...
rodney.m.bates at acm.org
Fri Nov 6 03:12:40 CET 2015
Author: Rodney Bates <rodney.m.bates at acm.org>
Date: 2015-11-05 (Thu, 05 Nov 2015)
Rework llvmbindings to circumvent ABI incompatibilities.
An unpleasant discovery: Even a struct/record with only one field
that is a pointer, is passed by value and returned in ways that are
incompatible at the machine level between gcc/clang C/C++ code
(these appear to be the same) and cm3 Modula-3 code, using the
gcc-derived back end, at least on AMD64_LINUX. Other targets
and compiler combinations are possibly also incompatible.
llvm's DIBuilder nodes are just such structs, and were being passed
by value, to avoid having to deal with copying and allocation/freeing
In this change, the struct/record surrounding is removed and the
enclosed pointer alone is passed.
Additionally, a couple of structs with two fields are changed
to be passed by reference, similar to other existing cases.
More information about the M3commit