This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Accessing Go type descriptors from the middle end


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]