All Projects β†’ MichaReiser β†’ Llvm Node

MichaReiser / Llvm Node

Licence: mit
Node LLVM 4.0+ Bindings

Projects that are alternatives of or similar to Llvm Node

Flamebearer
Blazing fast flame graph tool for V8 and Node πŸ”₯
Stars: ✭ 1,485 (+1069.29%)
Mutual labels:  v8
Volta
Compiler for the Volt Programming Language
Stars: ✭ 118 (-7.09%)
Mutual labels:  llvm
Metareflect
Metareflect is a lightweight reflection system for C++, based on LLVM and Clangs libtooling.
Stars: ✭ 125 (-1.57%)
Mutual labels:  llvm
Tapir Llvm
Tapir extension to LLVM for optimizing Parallel Programs
Stars: ✭ 109 (-14.17%)
Mutual labels:  llvm
Hikari
LLVM Obfuscator
Stars: ✭ 1,585 (+1148.03%)
Mutual labels:  llvm
Llvm Pass Tutorial
A step-by-step tutorial for building an LLVM sample pass
Stars: ✭ 122 (-3.94%)
Mutual labels:  llvm
Cppinsights
C++ Insights - See your source code with the eyes of a compiler
Stars: ✭ 1,382 (+988.19%)
Mutual labels:  llvm
Gllvm
Whole Program LLVM: wllvm ported to go
Stars: ✭ 126 (-0.79%)
Mutual labels:  llvm
Bacardi
Bacardi project is an effort to provide multi-language binding for Node.js native layer.
Stars: ✭ 115 (-9.45%)
Mutual labels:  v8
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 (-3.15%)
Mutual labels:  llvm
Opcde2017
Slides and very basic examples
Stars: ✭ 112 (-11.81%)
Mutual labels:  llvm
Flax
general purpose programming language, in the vein of C++
Stars: ✭ 111 (-12.6%)
Mutual labels:  llvm
Libebc
C++ Library and Tool for Extracting Embedded Bitcode
Stars: ✭ 122 (-3.94%)
Mutual labels:  llvm
Bin2llvm
A binary to LLVM translator
Stars: ✭ 108 (-14.96%)
Mutual labels:  llvm
V8js
V8 Javascript Engine for PHP β€” This PHP extension embeds the Google V8 Javascript Engine
Stars: ✭ 1,659 (+1206.3%)
Mutual labels:  v8
S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-19.69%)
Mutual labels:  llvm
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 (-3.94%)
Mutual labels:  llvm
Learn Javascript
γ€Šε‰η«―εŸΊη‘€ζΌ«ζΈΈζŒ‡ε—γ€‹ζ·±ε…₯ηš„γ€η³»η»Ÿηš„ε­¦δΉ  javascript εŸΊη‘€οΌŒε–œζ¬’η‚Ή Star
Stars: ✭ 128 (+0.79%)
Mutual labels:  v8
Proton Clang
Proton Clang toolchains builds in the form of a continuously updating Git repository. Clone with --depth=1.
Stars: ✭ 126 (-0.79%)
Mutual labels:  llvm
Llvm Mirror
NOTE: The LLVM project now operates official Git mirrors as well: http://llvm.org/docs/GettingStarted.html#git-mirror -- An automated mirror of llvm/trunk from LLVM's SVN. Updates hourly. Release branches and tags are tracked manually. This mirror is *not* commit-ID compatible with the official Git mirrors.
Stars: ✭ 122 (-3.94%)
Mutual labels:  llvm

llvm-node

Build Status npm version

Node Bindings for LLVM. The API is mostly identical to the one of LLVM (when possible and not to cumbersom). All supported methods with their signatures are listed in the TypeScript definition file.

Getting Started

Install the packages using npm or yarn.

npm install --save llvm-node

Require llvm-node and you're good to go

import * as llvm from "llvm-node";
// or
const llvm = require("llvm-node");

const context = new llvm.LLVMContext();
const module = new llvm.Module("test", context);

const intType = llvm.Type.getInt32Ty(context);
const initializer = llvm.ConstantInt.get(context, 0);
const globalVariable = new llvm.GlobalVariable(module, intType, true, llvm.LinkageTypes.InternalLinkage, initializer);

const ll = module.print(); // prints IR
llvm.writeBitcodeToFile(module, biteCodeFileName); // Writes file to disk

Custom LLVM Installation

You can use the npm configuration options to set the path to the LLVM cmake directory. This is needed if you don't want to use the system default LLVM installation --- e.g. when you want to compile againt the latest dev version.

To change the LLVM version use:

npm config set cmake_LLVM_DIR $(path-to-llvm/bin/llvm-config --cmakedir)

If you want to change the value just for a single project use an .npmrc file in your project.

Debug Build

If you want to use Value.dump or Module.dump you need to use the debug build of the library (and, as well, of LLVM). In this case, run node-gyp build --debug or if using npm install run npm_config_DEBUG=true npm install llvm-node.

There variables can also be set using npm set:

npm config set [--global] DEBUG True

Develop with VS-Code

  1. Install the C++ Extension
  2. Install the Cmake Tools Extension
  3. Configure the LLVM directory in the user settings by adding the following entry
"cmake.configureSettings": {
    "LLVM_DIR": "/usr/local/Cellar/llvm/7.0.0/lib/cmake/llvm" // Output of llvm-config --cmakedir
}
  1. Run the CMake:Configure Command in Visual Studio Code
  2. Run yarn configure from the command line
  3. Run CMake:Build command in Visual Studio Code
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].