[LLVMdev] Dynamic configuration for llvmc2

Patrick Walton pcwalton at cs.ucla.edu
Mon Nov 17 14:34:09 PST 2008


> Would it help if it was allowed to pass arguments to hooks?  So that
> you could write, for example:
> 
> (cmd_line "$CALL(MyHook, $INFILE, $OUTFILE)")

Well, what I found myself wanting was a dynamic (strconcat) dag that 
could join together strings and (call MyHook, INFILE, OUTFILE) dags.

> As Anton said, that was intentional. We wanted to minimize the number
> of dependencies and keep the driver lean and mean.

Definitely a good idea, which is why I wouldn't suggest Python or Perl 
:) For my plugin I would probably just add the Lua VM into the tree, so 
that there wouldn't be a dependency at all. It's under a compatible 
MIT/X11 license and is only 17k lines of ANSI C that should add around 
150k to the driver. For me the driver is about 350k, so that would mean 
a driver around 500k, which doesn't seem that big of a difference.

> I think that such a project could be useful - as long as it is
> implemented strictly as a plugin (of course, some things could be
> changed/added to the core to make life easier for you - but we're not
> going to add a dependency on the whole lua VM).
> 
> However, to make this work you will need more than just the ability to
> modify the compilation graph. One thing that comes to mind is the need
> to provide Lua implementations for the various Edge* classes
> (otherwise you can't use edges with non-default weights). You'll also
> need to interface with LLVM's CommandLine library somehow (easy to do
> in C++, where we just auto-generate the appropriate objects).

Right. I'll work on a proof of concept when I get some time. I 
anticipated this would be a bit of a hard sell, but I really think that 
a scriptable llvmc2 would be the right thing for several use cases.

Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3250 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081117/6373e335/attachment.bin>


More information about the llvm-dev mailing list