LLVMC plugin setup changed?

Hi,

I am trying to build my own llvmc plugin, but somehow, the llvm
makefiles do not pick up the plugin in the llvmc/plugins directory
anymore in a recent (r129445) svn checkout.
According to the tutorial (http://llvm.org/docs/CompilerDriverTutorial.html):
  $ cd tools/llvmc
  $ cp -r example/Simple plugins/Simple
  $ make LLVMC_BASED_DRIVER_NAME=mygcc LLVMC_BUILTIN_PLUGINS=Simple
does not build the Simple plugin but only files in the src directory.

I guess this commit changed the code but do not really understand what
the new approach is for llvmc plugins:
  r111094 | foldr | 2010-08-15 09:07:12 +0200 (Sun, 15 Aug 2010) | 1 line
  llvmc: remove dynamic plugins.

Currently, I simply replaced the include Base.td.in and Clang.td with
my own .td file, e.g.:
  $ cat tools/llvmc/src/Autogenerated.inc
      include "llvm/CompilerDriver/Common.td"

      //include "Base.td"
      //include "Clang.td"
      include "Simple.td"

Obviously this is not a clean solution. Any help to build the Simple
plugin (and hence my custom plugin) in a more decent way is greatly
appreciated!

Regards,
  Martijn Rutten

Hi,

Martijn <martijn <at> martijnrutten.com> writes:

Hi,

I am trying to build my own llvmc plugin,

[...]
Obviously this is not a clean solution. Any help to build the Simple
plugin (and hence my custom plugin) in a more decent way is greatly
appreciated!

Yes, support for dynamic plugins was removed from llvmc. The new approach is to
always generate a static executable. Basically, to build a working driver you
should start with $LLVMC_DIR/examples/Skeleton, put the TableGen code into
AutoGenerated.td and optional C++ code (hooks) into Hooks.cpp. This is how
llvmc/src itself is structured.

Sorry for the confusing documentation, I'll update it shortly.

Hi,

I've updated the documentation, hope this helps.

Hi Mikhail,

Thanks! I implemented my copy of the examples/Skeleton. Documentation
is clear now.

Thanks for the quick response,
  Martijn