Lehrinhalte
Modern compilers are primarily designed to produce efficient code for a particular platform and in doing so they employ sophisticated analysis and transformation tools. Such an infrastructure is useful also for source code transformation, e.g. for tools to annotate, instrument, or canonicalize codes. The complexity of C makes the development of such tools a challenging task.
An open compiler infrastructure used in a variety of research and production compilers is the LLVM infrastructure (www.llvm.org). A well-established front-end for C, C and objective C is Clang, which provides powerful mechanisms for extracting information from an abstract syntax tree representation of the underlying code, and thus enables source code modifications as well as the generation of the LLVM intermediate representation.

The students will work with different components and techniques of the Clang/LLVM framework and implement practical exercises for source transformation. The Clang/LLVM techniques include, in particular, handling and matching of the Clang abstract syntax tree. Examples for source transformation will highlight various facets of code augmentation or refactoring, e.g. for instrumenting parallel codes, for passing information between the static analysis and runtime environment of (parallel) codes, or for code refactoring to conform to coding standards.

Voraussetzungen
Lecture Introduction to Compiler Construction (EiCB), Lecture System- and Parallel Programming (SPP), Knowledge of C

Semester: Inverno 2019/20