Re: Software Architecture/Design

Mike Shaver <[email protected]> Wed, 16 Jun 2010 09:09:54 -0700
Newsgroups gmane.games.devel.sweng
Message-ID <[email protected]>
On Wed, Jun 16, 2010 at 8:38 AM, Jonathan Sauer <[email protected]> wrote:
>> I'm not aware of whether LLVM/Clang provides an equivalent way to
>> dynamically extend the compiler through a plugin. This would certainly be
>> preferably to having to mod the compiler directly.
>
> Given that there exists a static analyzer built on top of Clang, I guess the
> answer to
> your question is yes: <http://clang-analyzer.llvm.org/>

Does the clang-analyzer use a plugin API?  It looks like it's a
separate tool built on the clang libraries, not something that
augments the operation of the compiler, so you'd need to add another
pass to do analysis rather than build it into the passes you use to
build already.  For some uses that's fine, but where you want to do
customized generation (such as of metadata that goes into the
resultant binary) it can be pretty painful and error-prone in my
limited experience.

As far as getting the metadata you need for GC, I'm pretty sure it's
all in the debug info that compilers generate, since debuggers need
basically the same things for program and data navigation.  Working
with PDB on Windows can be a pain, but it's not impossible; DWARF2 on
other platforms is more pleasant.

Mike
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com