|A C compiler written in C targeting C email@example.com (1999-03-23)|
|Re: A C compiler written in C targeting C firstname.lastname@example.org (1999-03-28)|
|Re: A C compiler written in C targeting C email@example.com (Basim Kadhim) (1999-03-28)|
|Re: A C compiler written in C targeting C firstname.lastname@example.org (Nick Shaffner) (1999-03-28)|
|Re: A C compiler written in C targeting C email@example.com (1999-03-28)|
|Re: A C compiler written in C targeting C firstname.lastname@example.org (1999-03-28)|
|Re: A C compiler written in C targeting C email@example.com (1999-03-28)|
|[3 later articles]|
|From:||firstname.lastname@example.org (David Given)|
|Date:||23 Mar 1999 00:31:55 -0500|
|Organization:||I'm organised? Wow!|
|Keywords:||C, question, comment|
Yes, I know it's an odd request.
I have an operating system with strange memory semantics (GEOS, if
you're interested). Blocks of memory may move at any time unless
locked down. You're not supposed to leave blocks locked. You refer to
blocks by their handles.
So, to read from memory, you lock the handle, which gives you a
pointer; dereference the pointer; and then unlock the handle again.
This all works very nicely except that standard ANSI C programs won't
run, because they expect fixed blocks of memory.
What I want to do is write a C compiler that changes the pointer
semantics of the program, emitting another program that I can feed
into GEOS' odd C compiler.
I'm currently playing with lcc, and have a fair amount of success; I
have a back end that generates more-or-less correct C code, and
pointer dereferences are correctly wrapped, but the output code is
still going to be dire. I can't get lcc to let me handle switch
statements, for example, and since I can't use jump tables it's going
to produce a sequence of if...goto pairs.
Are there any compilers (lcc, gcc) around that have C back ends? Are
there any type analysis tools around that can be modified to write out
the code once they've read it in (because I don't need a fully fledged
code generator)? Am I going at this in completely the wrong way?
+- David Given ---------------McQ-
| Work: email@example.com
| Play: firstname.lastname@example.org
+- http://wired.st-and.ac.uk/~dg -
[MacOS does sort of the same thing, maybe there's some hackery there. -John]
Return to the
Search the comp.compilers archives again.