[llvm-dev] [DevTool] LLVM executable/pass project template generator

Bekket McClane via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 31 18:08:38 PDT 2017


I’d just wrote a small tool that helps developers to quickly create an out-of-tree LLVM executable/pass project template.
https://github.com/mshockwave/generator-llvm <https://github.com/mshockwave/generator-llvm>
It leverages the yeoman framework in Node.js, which is widely used to generate templates for different kinds of web from-end projects.
After installing Node.js and npm, you just need to install yeoman and this generator:

	npm install -g yo
	npm install -g generator-llvm

After that, please refer the README for generating different kinds of project. For example, creating template for a LLVM pass project:
	yo llvm:pass init

I have to admit that remembering the minimum source code and CMakeLists.txt for a LLVM executable or pass is not so hard - but typing them are often boring boilerplate jobs
Sometimes we just want to prototype our optimization algorithm or inspecting some API behaviors, so the real body of code is often short, and it make sense to bootstrap the essential of a project by automatic tools.

I think this project can also be a good tool for helping new comers to get familiar with LLVM. 
Please don’t hesitate to improve the template code by either leaving comments in this thread or sending PR to the repo. 

P.S. I understand that most of the folks here is more familiar with python and I believe that there are many great template libraries in python. However, yeoman is a mature framework for not just template engine, but project bootstrapping, also, Node.js is easy to install, access, and getting more and more common nowadays. 

P.S.S. If you want to modify the template code directly, here is the reference for the template engine that may help: http://ejs.co/ <http://ejs.co/> 

Best Regards,
Bekket McClane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170731/6015f6cf/attachment.html>

More information about the llvm-dev mailing list