background preloader

The LLVM Compiler Infrastructure Project

The LLVM Compiler Infrastructure Project

LLVM Un article de Wikipédia, l'encyclopédie libre. Caractéristiques[modifier | modifier le code] Compilation[modifier | modifier le code] Jusqu'à la version 2.9, LLVM offrait une compilation C/C++ et ObjectiveC via LLVM-GCC. Représentation du code[modifier | modifier le code] LLVM offre un ensemble d'instructions indépendant de tout langage et de tout système. Notes et références[modifier | modifier le code] La publication de la version 3.3 : Liens externes[modifier | modifier le code] Clang Static Analyzer build AST from ObjC code written by Nico Weber Introduction From clang’s website: The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler. What does that mean, and why should you care? Once you have an AST of a program, you can do many things with the program that are hard without an AST. Front-ends have existed for decades. So, do you have a large C code-base and want to create automated non-trivial refactorings? This tutorial will offer a tour through clang’s preprocessor, parser, and AST libraries. A short word of warning: clang is still work in prograss. Clang works on all platforms. Getting started There is no official release of clang yet, you have to get it from SVN and build it for yourself. svn co llvm cd llvm PATH=$PATH:/Applications/Graphviz.app/Contents/MacOS . If you call . Note that this does a debug build of llvm and clang. You can find more information in clang’s official getting started guide. .

Tutorial Introduction and the Lexer 1.1. Tutorial Introduction Welcome to the “Implementing a language with LLVM” tutorial. This tutorial runs through the implementation of a simple language, showing how fun and easy it can be. This tutorial will get you up and started as well as help to build a framework you can extend to other languages. The code in this tutorial can also be used as a playground to hack on other LLVM specific things. The goal of this tutorial is to progressively unveil our language, describing how it is built up over time. It is useful to point out ahead of time that this tutorial is really about teaching compiler techniques and LLVM specifically, not about teaching modern and sane software engineering principles. I’ve tried to put this tutorial together in a way that makes chapters easy to skip over if you are already familiar with or are uninterested in the various pieces. By the end of the tutorial, we’ll have written a bit less than 700 lines of non-comment, non-blank, lines of code. 1.2. 1.3.

Related: