Accessing Go type descriptors from the middle end

Ian Lance Taylor iant@google.com
Fri Dec 14 00:11:00 GMT 2012


On Thu, Dec 13, 2012 at 3:52 PM, Matt Davis <mattdavis9@gmail.com> wrote:
>
> On Fri, Dec 14, 2012 at 10:00 AM, Ian Lance Taylor <iant@google.com> wrote:
>> On Thu, Dec 13, 2012 at 4:16 AM, Matt Davis <mattdavis9@gmail.com> wrote:
>>>
>>> I have a GIMPLE pass and would like to make use of the data type
>>> information that the Go frontend produces.  Is there a way to access
>>> this information from the middle end without having to query the
>>> frontend?
>>
>> What kind of data type information are you interested in?
>
> I am working on an implementation of my alternate memory allocator for Go.
> This allocator makes use of the layout of data types.  I was hoping to
> use the existing descriptors that are generated by the frontend, so
> that I would not have to create my own.  My runtime will make use of
> these descriptors. However, it would suit me just as well to create my
> own type-information.  It will just bloat the binary a bit, but, for
> my purposes, that is no big deal.

The Go frontend allocates memory by calling just a few magic
functions, all listed in gcc/go/gofrontend/runtime.def.  I would
change those functions to take a type descriptor as a parameter where
they don't already do so.  Then you can reliably find them in your
GIMPLE pass and get the Go type descriptor.

Ian



More information about the Gcc mailing list