All Projects → lijiansong → Clang Llvm Tutorial

lijiansong / Clang Llvm Tutorial

Licence: wtfpl
clang & llvm examples, e.g. AST Interpreter, Function Pointer Analysis, Value Range Analysis, Data-Flow Analysis, Andersen Pointer Analysis, LLVM Backend...

Labels

Projects that are alternatives of or similar to Clang Llvm Tutorial

Gllvm
Whole Program LLVM: wllvm ported to go
Stars: ✭ 126 (-9.35%)
Mutual labels:  llvm, clang
Metareflect
Metareflect is a lightweight reflection system for C++, based on LLVM and Clangs libtooling.
Stars: ✭ 125 (-10.07%)
Mutual labels:  llvm, clang
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+714.39%)
Mutual labels:  llvm, clang
Bsodsurvivor
This project aims to facilitate debugging a kernel driver in windows by adding support for a code change on the fly without reboot/unload, and more!
Stars: ✭ 122 (-12.23%)
Mutual labels:  llvm, clang
Termux Ndk
android-ndk for termux
Stars: ✭ 91 (-34.53%)
Mutual labels:  llvm, clang
Zapcc
zapcc is a caching C++ compiler based on clang, designed to perform faster compilations
Stars: ✭ 1,109 (+697.84%)
Mutual labels:  llvm, clang
Meta Clang
Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
Stars: ✭ 76 (-45.32%)
Mutual labels:  llvm, clang
Woboq codebrowser
Woboq CodeBrowser
Stars: ✭ 837 (+502.16%)
Mutual labels:  llvm, clang
Llvm Utils
LLVM/Clang for Visual Studio 2019, 2017, 2015, 2013, 2012 and 2010. clang-cl for Python3 distutils. Utils for Clang Static Analyzer
Stars: ✭ 123 (-11.51%)
Mutual labels:  llvm, clang
Llvm Vs2017 Integration
MSBuild 15.0 Toolset integration for multiple LLVM (From v5 to v8)
Stars: ✭ 84 (-39.57%)
Mutual labels:  llvm, clang
Cxxctp
DEPRECATED. USE INSTEAD github.com/blockspacer/flextool
Stars: ✭ 58 (-58.27%)
Mutual labels:  llvm, clang
Cppinsights
C++ Insights - See your source code with the eyes of a compiler
Stars: ✭ 1,382 (+894.24%)
Mutual labels:  llvm, clang
Llvm 9.0 Learner Tutorial
A blog for LLVM(v9.0.0 or v11.0.0) beginner, step by step, with detailed documents and comments. Record the way I learn LLVM and accomplish a complete project for FPGA High-Level Synthesis with it.
Stars: ✭ 58 (-58.27%)
Mutual labels:  llvm, clang
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: ✭ 63 (-54.68%)
Mutual labels:  llvm, clang
C2goasm
C to Go Assembly
Stars: ✭ 1,072 (+671.22%)
Mutual labels:  llvm, clang
Seeless
C IDE for iOS
Stars: ✭ 71 (-48.92%)
Mutual labels:  llvm, clang
Enzyme
High-performance automatic differentiation of LLVM.
Stars: ✭ 418 (+200.72%)
Mutual labels:  llvm, clang
Fcd
An optimizing decompiler
Stars: ✭ 622 (+347.48%)
Mutual labels:  llvm, clang
Codechecker
CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
Stars: ✭ 1,209 (+769.78%)
Mutual labels:  llvm, clang
Tre
LLVM backed progamming language (Go subset)
Stars: ✭ 100 (-28.06%)
Mutual labels:  llvm, clang

Clang and LLVM Tutorial

License: WTFPL

This archieve is mainly about some interesting examples of clang and llvm... Some of them are the homework of my postgraduate course, some of them are others, most of them are toy code : )

Contents

AST Interpreter

An interpreter of clang abstract syntax tree, toy code, now it only support integer type. It supports basic modules of programming language, e.g. ifstmt, whilestmt, function call, malloc and array... For more info, see here...

Function Pointer Pass

Implement of use-def chains based on the LLVM IR and bitcode, now it supports direct function calls and function pointer. For the case of function pointer, calculate the functions that may call, if it is determined, replace it with direct function call and write into the bitcode file. Also take the situation that the function pointers are stored in memory into consideration.

Value Range Analysis

Value range analysis is a type of data flow analysis that tracks the range (interval) of values that a numeric variable can take on at each point of a program's execution.
The resulting information can be used in optimizations such as redundancy elimination, dead code elimination, instruction selection, etc. But can also be used to improve the safety of programs, e.g. in the detection of buffer overruns. Techniques for value range analysis typically use symbolic analysis extensively. When it comes to the detailed implement, for each basic block, define the following data-flow equation:

in[B] = ∪ out[A] | A∈ pred(B) && A!=S
out[B] = in[B]∪gen[B]

Data Flow Analysis

Homework of foreign CS course --- Advanced Compilers, for more detail, see here...

Andersen Pointer Analysis

Implement of Andersen's pointer analysis algorithm, for more info, see here...

LLVM Backend

For a compiling system, I think the most complex part is the back end, you have to be proficient in instruction sets of the target processor and familiar with its architecture. Lots of things have to be done, e.g. instruction selection, instruction scheduling, register allocation, code emission and etc. Here i will provide you will an example, for more details, see here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].