[llvm-commits] Re: Dynamically loadable targets

Vladimir Prus ghost at cs.msu.su
Mon Jul 12 01:40:03 PDT 2004


Hi Chris,

> I just checked in support for auto-registrating targets.  

This is cool. I though I'd try to do it myself, but you was faster ;-)

> I think that 
> this should make your lives substantially easier by not having to have
> hacky code in llc.cpp, the allocate*TargetMachine business is now all
> gone, and you can even dynamically load your targets as plugins to avoid
> having to rebuild llc all of the time.

......

> 4. You must register your target with RegisterTarget<X>.

That's actually the only thing I needed.

> 6. You can choose to either statically link your TargetMachine into
>    llc/lli or to dynamically load it with -load.

Well, actually, I'm already use Boost.Build, so I do dynamic linking to all 
targets without -load, and don't have to rebuild llc already ;-) The change 
is still good, because it eliminates the need to declare all targets in one 
place and besides, using -load is good sometimes.

- Volodya






More information about the llvm-commits mailing list