[LLVMdev] Can I port LLVM as a source-to-source compiler?

Reid Kleckner rnk at mit.edu
Tue Jan 19 10:04:28 PST 2010

On Mon, Jan 18, 2010 at 10:58 PM, Junchao Zhang <junchao.zhang at gmail.com> wrote:
> Hello,
> I am working in a project on a parallel programming language. I want to base
> our language on Java or C/C++. But Java is preferred.
> Many similar projects adopts a source-to-source methodology, e.g., Berkeley
> UPC(using Open64), Titanium, and Rice University's Co-array Fortran. They
> output C code with calls to the runtime.  I think there are at least three
> reasons: 1) using C as the output, it gets more portability. 2) leverage the
> front ends of existing compilers. 3) leverage optimizations in existing
> compilers.
> I wonder if LLVM is suitable for this kind of work. Can LLVM experienced
> users give me some hints on this topic?

No, I don't think that LLVM would be useful for making a
source-to-source compiler.  LLVM itself is mostly concerned with
optimizations and code generation.  It doesn't have any code for
representing any high-level ASTs or doing type checking on them.  You
could look at clang, though, if for some reason you need an AST for C.


More information about the llvm-dev mailing list