[M3devel] backend mode integratedassembly
Jay K
jay.krell at cornell.edu
Sat Sep 15 00:44:49 CEST 2012
It somewhat gets in the way of reading/writing the code.It bit-rots. I kind of think this area needs a bit of a reworking.There could/should be more code sharing. (Or maybe actually less infrastructure.) If anyone really did write an integrated backend that produced assembly, they could/should then have that backend go ahead and have that backend call the assembler. Maybe. The -boot and -keep flags should perhaps be passed on the backend. By this measure, I might as well just call my C backend "IntegratedObject", and have it call out to quake/config to run the C compiler -- heck, esp. if RunCC was made part of Builder.i3 instead of just Builder.m3 (or passed down as a function pointer -- I guess otherwise there might be a circular dependency). I nearly did that.I guess I was too lazy to teach my backend how to call out to the C compiler via quake, rather than reuse Builder.m3. That is...I'm not sure there should be any modes at all.There should be "types" which is just which Interface.T implementation of M3CG to instantiate.They would all be "IntegratedObject".C backend would like I said, generate C itself, then call out to quake/compile_c.(It could almost just be "cc foo.c -o foo.o", but that isn't quite adequate/portable). IntegratedAssembly would generate assemlby, then call out to quake/assemble, if it doesn't know otherwise. m3cc/m3back/m3cg would be a very thin wrapper over m3cg.Everything but open/close would call down to m3cg_binwr.At close time, it would call out to quake/config to run the assembler, if not bootstrapping. I like it -- no modes, just specific types. They would all be treated as "IntegratedObject". Question would how much sharing/commonality is there really. I guess it doesn't matter much... I guess "externals" backends are convenient, to test?So going though m3cg_binwr is nice?So then you get commonality there? I'm still not sure that belongs in Builder.m3, vs. "M3CG_ExternalViaBinWr".Which could know about the boot/keep flags and keep the .mc files.. - Jay
Subject: Re: [M3devel] backend mode integratedassembly
From: hosking at cs.purdue.edu
Date: Fri, 14 Sep 2012 17:07:28 -0400
CC: m3devel at elegosoft.com
To: jay.krell at cornell.edu
On Sep 14, 2012, at 4:24 PM, Jay K <jay.krell at cornell.edu> wrote:There is a backend mode for an integrated backend that generates assembly.This is dead code, right?Remove it?
<* ASSERT FALSE *> (but then I get warnings about unreachable code -- comment it out?
There is nothing to be gained from removing it.Maybe someone will want to experiment/resurrect.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120914/ce011702/attachment-0002.html>
More information about the M3devel
mailing list