All Projects → nsumner → Llvm Demo

nsumner / Llvm Demo

Licence: mit
A simple example of how LLVM can be used to gather static or dynamic facts about a program.

Labels

Projects that are alternatives of or similar to Llvm Demo

Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (+47.92%)
Mutual labels:  llvm, demo
Create React Redux App
This project was bootstrapped with Create React App and Redux, Sass Structure.
Stars: ✭ 46 (-4.17%)
Mutual labels:  demo
Start laravel
Let this application be your quick start to Laravel, It'll help you to build your app structure and show you each component of Laravel and how to best practice them.
Stars: ✭ 42 (-12.5%)
Mutual labels:  demo
Stoat
STatic (LLVM) Object file Analysis Tool
Stars: ✭ 44 (-8.33%)
Mutual labels:  llvm
Ezplatform Demo
Fork of "ezplatform" meta repository, contains code and dependencies for demo distribution of eZ Platform. Not recommended for a clean install for new projects, but great for observation and learning!
Stars: ✭ 42 (-12.5%)
Mutual labels:  demo
Wheelview
a great functional custom WheelView with demo in dialog and bottomDialog,android 滚动选择控件,滚动选择器,时间选择,日期选择
Stars: ✭ 44 (-8.33%)
Mutual labels:  demo
Tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
Stars: ✭ 9,068 (+18791.67%)
Mutual labels:  llvm
Polymer Quill
Polymer Quill Rich Text Editor
Stars: ✭ 48 (+0%)
Mutual labels:  demo
Vantweappmpvuedemo
mpvue中使用Vant Weapp
Stars: ✭ 46 (-4.17%)
Mutual labels:  demo
Llvm2graphml
Explore LLVM Bitcode interactively using a graph database
Stars: ✭ 44 (-8.33%)
Mutual labels:  llvm
Flutter Chat Demo
The chat app made by Flutter and Firebase
Stars: ✭ 1,016 (+2016.67%)
Mutual labels:  demo
Beziercurve
Bezier curve master
Stars: ✭ 43 (-10.42%)
Mutual labels:  demo
Examples
Demo applications and code examples for Confluent Platform and Apache Kafka
Stars: ✭ 571 (+1089.58%)
Mutual labels:  demo
Domtresat
Dominator Tree LLVM Pass to Test Satisfiability
Stars: ✭ 42 (-12.5%)
Mutual labels:  llvm
Leekscript V2
A dynamically typed, compiled just-in-time programming language used in Leek Wars' AIs
Stars: ✭ 46 (-4.17%)
Mutual labels:  llvm
Realtime Detectron
Real-time Detectron using webcam.
Stars: ✭ 42 (-12.5%)
Mutual labels:  demo
Processwarp
Stars: ✭ 43 (-10.42%)
Mutual labels:  llvm
Rellume
Lift x86-64 to performant LLVM IR
Stars: ✭ 45 (-6.25%)
Mutual labels:  llvm
Nectarine
🍑 A mobile web / Android app for Peach! (peach.cool) ⚡️
Stars: ✭ 48 (+0%)
Mutual labels:  demo
Mygoogleplaces
A simple demo of Google Places.
Stars: ✭ 46 (-4.17%)
Mutual labels:  demo

These programs are demonstrations of how LLVM can be used for (very simple) static and dynamic analyses. However, they use many of the initial building blocks necessary for solving more complex problems.

The provided analyses count the number of direct invocations of a particular function are present within a program or within and execution depending on whether static or dynamic analysis is used.

Building with CMake

  1. Clone the demo repository.

     git clone https://github.com/nsumner/llvm-demo.git
    
  2. Create a new directory for building.

     mkdir demobuild
    
  3. Change into the new directory.

     cd demobuild
    
  4. Run CMake with the path to the LLVM source.

     cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=True \
         -DLLVM_DIR=</path/to/LLVM/build>/lib/cmake/llvm/ ../llvm-demo
    
  5. Run make inside the build directory:

     make
    

This produces a callcounter tool called bin/callcounter and supporting libraries in lib/.

Note, building with a tool like ninja can be done by adding -G Ninja to the cmake invocation and running ninja instead of make.

Running

First suppose that you have a program compiled to bitcode:

clang -g -c -emit-llvm ../llvm-demo/test/simpletest.c -o calls.bc

Running the dynamic call printer:

bin/callcounter -dynamic calls.bc -o calls
./calls

Running the static call printer:

bin/callcounter -static calls.bc

or by loading the pass as a plugin for opt:

opt -analyze -load lib/libcallcounter-lib.so -callcounter calls.bc
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].