[LLVMdev] a very beginning question
sabre at nondot.org
Mon Sep 5 21:05:16 PDT 2005
On Mon, 5 Sep 2005 shding at mtu.edu wrote:
> Thank you.
> I'm only consider about how the compiler comiles c program to LLVM IR.
> I know there should be a scanner, parser, and IR generator. But where
> is the main entrance and how about the flow of the process, especially
> about the IR generator?
This all exists in the llvm-gcc project, which you can check out per
Reid's instructions. We use a mostly unmodified GCC lexer and parser (see
the gcc internals manual for details). The LLVM specific parts are in the
gcc/llvm-* files, most notably llvm-expand.c which converts the GCC AST to
>> shding at mtu.edu wrote:
>>> Where can I find the main function of llvm compiler in the source
>> Well, there's a loaded question. :)
>> It depends on "which" compiler you mean. If you're talking about the
>> and llvm-g++ compilers (C/C++ to LLVM) then they are in the downloadable
>> tarballs available here: http://llvm.cs.uiuc.edu/releases/. You can also
>> them via CVS using the llvm-gcc repository name.
>> If you're talking about the llc compiler (LLVM to machine code), it is in
>> llvm repository under tools/llc, however most of the code consists of the
>> various libraries that make up LLVM (viewable at
>> http://illuvium.com/cgi-bin/cvsweb.cgi/llvm/lib/), in particular the
>> (lib/AsmParser), Bytecode facilities (lib/Bytecode), code generation code
>> (lib/Codegen), and target-specific translators (lib/Target).
>> If you're talking about the generic compiler, llvmc, you can find it at
>> tools/llvmc directory.
>> If you're talking about the (partially complete) Java interface, you can
>> it in the llvm-java repository.
>> If you're talking about the Stacker compiler, you can find it in the llvm
>> repository at projects/Stacker/lib/compiler.
>> Hope this helps.
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev