LLVM bindings for Node.js/JavaScript/TypeScript

Overview

llvm-bindings

LLVM bindings for Node.js/JavaScript/TypeScript

Supported OS

  • macOS
  • Ubuntu
  • Windows

Supported LLVM methods

listed in the TypeScript definition file.

Install

Install on macOS

# install cmake and llvm by homebrew
brew install cmake llvm

# install llvm-bindings by npm
npm install llvm-bindings

Install on Ubuntu

#install llvm by installation script
wget https://apt.llvm.org/llvm.sh
sudo chmod +x llvm.sh
sudo ./llvm.sh

# install cmake by apt-get
sudo apt-get install cmake

# install llvm-bindings by npm
npm install llvm-bindings

Usage

// If you have configured ES module or TypeScript, you can replace the next line with `import llvm from 'llvm-bindings';`
const llvm = require('llvm-bindings');

const context = new llvm.LLVMContext();
const mod = new llvm.Module('demo', context);
const builder = new llvm.IRBuilder(context);

const returnType = builder.getInt32Ty();
const paramTypes = [builder.getInt32Ty(), builder.getInt32Ty()];
const functionType = llvm.FunctionType.get(returnType, paramTypes, false);
const func = llvm.Function.Create(functionType, llvm.Function.LinkageTypes.ExternalLinkage, 'add', mod);

const entryBB = llvm.BasicBlock.Create(context, 'entry', func);
builder.SetInsertionPoint(entryBB);

const a = func.getArg(0);
const b = func.getArg(1);
const result = builder.CreateAdd(a, b);
builder.CreateRet(result);

if (!llvm.verifyFunction(func) && !llvm.verifyModule(mod)) {
    mod.print();
}

You cannot declare a variable or constant named module in top level, because module is a built-in object in Node.js.

Note

Due to the limitation of node-addon-api, this project has not implemented inheritance yet, so calling the method of superclass from subclass object will report an error. Please see #1 for details.

Compatibility

llvm-bindings versions compatible LLVM versions
0.0.x, 0.1.x 11.0.x, 11.1.x
0.2.x 12.0.x

Acknowledgments

llvm-bindings is mostly inspired by llvm-node.

Issues
  • Unable to run on Monterey on M1 MacBook Pro

    Unable to run on Monterey on M1 MacBook Pro

    • OS version: Mac OS 12.0.1 M1 MacBook Pro
    • Node.js version: 17.01
    • LLVM version: 13

    Was able to successfully install the npm module on a brand new M1 MacBook but run into runtime errors when trying to launch:

    Error: dlopen(node_modules/llvm-bindings/build/Release/llvm-bindings.node, 0x0001): symbol not found in flat namespace '_LLVMInitializeAArch64AsmParser

    Expected behavior

    Everything works fine on an Intel Mac. I am assuming that there are some issues with M1 Mac's being Arm?

    bug 
    opened by wintermute-motherbrain 14
  • [Bug] CreateAlloca causes segmentation fault

    [Bug] CreateAlloca causes segmentation fault

    Your environment

    • OS version: MacOS monterey
    • Node.js version: 17.6.0
    • LLVM version: 13

    Describe the bug

    Essentially, if I pass an IRBuilder around a few functions as an argument, (I haven't tested without doing this but I strongly assume that nothing would change if I used it in its original function) CreateAlloca causes a segmentation fault. It used to work and I haven't changed anything about how I use it but it still doesn't work. I have tried manually declaring all of the values so I am sure there is nothing wrong with them. This is how I am using it:

    builder.CreateAlloca(builder.getInt64Ty(), null, name)
    

    All I get is a segmentation fault. I have run SetInsertPoint if you are wondering.

    Expected behavior

    No segmentation fault, a variable to be created

    opened by jso8910 7
  • Can't install llvm-bindings on ubuntu 20.04

    Can't install llvm-bindings on ubuntu 20.04

    npm ERR! command failed
    npm ERR! command sh -c cross-env CMAKE_BUILD_PARALLEL_LEVEL=$(node -p 'require(`os`).cpus().length') cmake-js compile
    npm ERR! [
    npm ERR!   '/usr/bin/node',
    npm ERR!   '/root/code/flowge/node_modules/.bin/cmake-js',
    npm ERR!   'compile'
    npm ERR! ]
    npm ERR! info TOOL Using Unix Makefiles generator.
    npm ERR! info CMD CONFIGURE
    npm ERR! info RUN [
    npm ERR! info RUN   'cmake',
    npm ERR! info RUN   '/root/code/flowge/node_modules/llvm-bindings',
    npm ERR! info RUN   '--no-warn-unused-cli',
    npm ERR! info RUN   '-G',
    npm ERR! info RUN   'Unix Makefiles',
    npm ERR! info RUN   '-DCMAKE_JS_VERSION=6.3.0',
    npm ERR! info RUN   '-DCMAKE_BUILD_TYPE=Release',
    npm ERR! info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/code/flowge/node_modules/llvm-bindings/build/Release',
    npm ERR! info RUN   '-DCMAKE_JS_INC=/root/.cmake-js/node-x64/v17.3.1/include/node',
    npm ERR! info RUN   '-DCMAKE_JS_SRC=',
    npm ERR! info RUN   '-DNODE_RUNTIME=node',
    npm ERR! info RUN   '-DNODE_RUNTIMEVERSION=17.3.1',
    npm ERR! info RUN   '-DNODE_ARCH=x64'
    npm ERR! info RUN ]
    npm ERR! info REP Build has been failed, trying to do a full rebuild.
    npm ERR! info CMD CLEAN
    npm ERR! info RUN [
    npm ERR! info RUN   'cmake',
    npm ERR! info RUN   '-E',
    npm ERR! info RUN   'remove_directory',
    npm ERR! info RUN   '/root/code/flowge/node_modules/llvm-bindings/build'
    npm ERR! info RUN ]
    npm ERR! info CMD CONFIGURE
    npm ERR! info RUN [
    npm ERR! info RUN   'cmake',
    npm ERR! info RUN   '/root/code/flowge/node_modules/llvm-bindings',
    npm ERR! info RUN   '--no-warn-unused-cli',
    npm ERR! info RUN   '-G',
    npm ERR! info RUN   'Unix Makefiles',
    npm ERR! info RUN   '-DCMAKE_JS_VERSION=6.3.0',
    npm ERR! info RUN   '-DCMAKE_BUILD_TYPE=Release',
    npm ERR! info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/root/code/flowge/node_modules/llvm-bindings/build/Release',
    npm ERR! info RUN   '-DCMAKE_JS_INC=/root/.cmake-js/node-x64/v17.3.1/include/node',
    npm ERR! info RUN   '-DCMAKE_JS_SRC=',
    npm ERR! info RUN   '-DNODE_RUNTIME=node',
    npm ERR! info RUN   '-DNODE_RUNTIMEVERSION=17.3.1',
    npm ERR! info RUN   '-DNODE_ARCH=x64'
    npm ERR! info RUN ]
    npm ERR! ERR! OMG Process terminated: 1 
    

    I can't install llvm-bindings and this is what I get.. :/

    opened by YiraSan 5
  • postinstall - no member named 'getTypeByName' in 'llvm::Module'

    postinstall - no member named 'getTypeByName' in 'llvm::Module'

    postinstall gives this error:

    src/IR/Module.cpp:101:38: error: no member named 'getTypeByName' in 'llvm::Module'
        llvm::StructType *type = module->getTypeByName(name);
                                 ~~~~~~  ^
    

    Commenting out lines 101-104 at least allows postinstall to complete

    opened by bconnorwhite 5
  • [Bug] Command to install in Windows 10 not working

    [Bug] Command to install in Windows 10 not working

    Your environment

    • OS version: Windows 10
    • Node.js version: N/A
    • LLVM version: 13.0.1

    Describe the bug I ran this command, after doing the first few steps in the wiki:

    cmake -Thost=x64 -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_INCLUDE_TESTS=OFF ..
    CMake Error: The source directory "C:/LLVM" does not appear to contain CMakeLists.txt.
    Specify --help for usage, or press the help button on the CMake GUI.
    

    I think I need to cd to a specific dir first.

    Expected behavior Not CMake error.

    opened by ChocolateLoverRaj 4
  • error: use of undeclared identifier 'napi_object_freeze'

    error: use of undeclared identifier 'napi_object_freeze'

    I noticed a bunch of "use of undeclared identifier" errors after upgrading to v0.2.0 coming from node-addon-api on postinstall (with node v15), downgrading to node v14 fixes the issue

    opened by bconnorwhite 4
  • [Bug] CreateGEP causes segmentation fault

    [Bug] CreateGEP causes segmentation fault

    Your environment

    • OS version: macOS Monterey 12.1
    • Node.js version: 17.1.0
    • LLVM version: 13.0.1

    Describe the bug

    I'm trying to create a getelementptr statement using the bindings, but I get a segmentation fault when I run the program.

    const printConst = builder.CreateGlobalString(
      printArg.text,
      `${VARIABLE_STRING_PREFIX}.${VARIABLE_COUNT_GLOBAL}`,
      0,
      module
    );
    builder.CreateGEP(printConst.getType(), printConst, [
      builder.getInt64(0),
      builder.getInt64(0),
    ]);
    

    Expected behavior

    It should produce a statement similar to this:

    %cast210 = getelementptr [13 x i8],[13 x i8]* @.str, i64 0, i64 0
    
    opened by raphtlw 2
  • Memory intrinsics not working

    Memory intrinsics not working

    It seems that trying to access any of the memory intrinsic functions will cause a seg fault e.g.:

    const memcpy = llvm.Intrinsic.getDeclaration(module, llvm.Intrinsic.memmove)

    The intrinsic function highlighted in the test folder (debugtrap) does work but none of the memory related ones seem to work (memcpy, memcpy_inline, memmove, etc).

    Also, thank you for putting this library together, its great to finally have access to the larger feature set of llvm through node!

    good first issue 
    opened by wintermute-motherbrain 2
  • Crash when writing bitcode if using addBasicBlock

    Crash when writing bitcode if using addBasicBlock

    • OS version: macOS 11.6
    • Node.js version: v17.0.1
    • LLVM version: 13.0.0

    It is possible to get a seg fault when executing the function WriteBitcodeToFile. The crash occurs about 1/10 times when running the same code over and over. I have not been able to create an isolated test case but this code is at the root of the issue:

    `const test = load(s.test) // <-- load a value const parent = builder.GetInsertBlock().getParent() const thenBlock = llvm.BasicBlock.Create(context, "then", parent) const elseBlock = llvm.BasicBlock.Create(context, "else", parent) const continueBlock = llvm.BasicBlock.Create(context, "ifcont", parent)

    builder.CreateCondBr(test, thenBlock, elseBlock)

    parent.addBasicBlock(thenBlock) builder.SetInsertPoint(thenBlock) gen(s.consequent) builder.CreateBr(continueBlock)

    parent.addBasicBlock(elseBlock) builder.SetInsertPoint(elseBlock) gen(s.alternate) <--- generate additional if else builder.CreateBr(continueBlock)

    parent.addBasicBlock(continueBlock) builder.SetInsertPoint(continueBlock)`

    If I print out the module before writing the bitcode, the IR is always the same/valid. My hunch is its something to do with the addBasicBlock specifically (since that seems to be a custom function). If I remove the calls to addBasicBlock, I don't get the crash.

    Expected behavior

    Won't crash on valid IR when writing bitcode.

    opened by wintermute-motherbrain 1
  • Allow undefined for middle arguments

    Allow undefined for middle arguments

    For function signatures with multiple undefined arguments, middle arguments left undefined cause an error.
    Example function signature:

    llvm.BasicBlock.Create(
      context: llvm.LLVMContext,
      name?: string | undefined,
      parent?: llvm.Function | undefined,
      insertBefore?: llvm.BasicBlock | undefined
    ): llvm.BasicBlock
    

    Example usage:

    llvm.BasicBlock.Create(context, undefined, parent); // error
    llvm.BasicBlock.Create(context, "name", parent);    // ok
    

    The change I made only fixes this for name on this particular function, I can help find other examples if you are ok with this

    opened by bconnorwhite 1
  • chore(deps): bump node-addon-api from 4.3.0 to 5.0.0

    chore(deps): bump node-addon-api from 4.3.0 to 5.0.0

    Bumps node-addon-api from 4.3.0 to 5.0.0.

    Release notes

    Sourced from node-addon-api's releases.

    Release 5.0.0

    SemVer major release to pull changes since the last release. The main motivations for the release are:

    • Drop the support for Node.js v12.x.
    • Marked methods of wrapper classes const.
    • Enabled wrapping Napi namespace with custom namespace.
    • Added an override to Napi::Function::Call to call it with a c-style array of Napi::Value's.
    • Improved the test framework. Added the possibility to run subsets of tests more easily.
    • Added test for Napi::AsyncContext class.
    • Fixed ramdom failure on test for Napi::ThreadSafeFunction e Napi::TypedThreadSafeFunction class.
    • Fixed compilation problem on debian 8 system.
    • Added test for Napi::Object::Set() method.
    • Added some clarifications for Napi::ClassPropertyDescriptor.
    • Added clarification about weak reference for Napi::ObjectWrap.
    • Some minor fixes all over the documentation.
    • Fixed eslint configuration.
    • Fixed CI configuration for Windows.
    • Enabled pre-commit ClangFormat on Windows.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/nodejs/node-addon-api/compare/v4.3.0...v5.0.0

    Changelog

    Sourced from node-addon-api's changelog.

    2022-05-02 Version 5.0.0, @​NickNaso

    Notable changes:

    API

    • Marked methods of wrapper classes const.
    • Enabled wrapping Napi namespace with custom namespace.
    • Added an override to Napi::Function::Call to call it with a c-style array of Napi::Value's.
    • Some other minor fixes.

    TEST

    • Improved the test framework. Added the possibility to run subsets of tests more easily.
    • Added test for Napi::AsyncContext class.
    • Fixed ramdom failure on test for Napi::ThreadSafeFunction e Napi::TypedThreadSafeFunction class.
    • Fixed compilation problem on debian 8 system.
    • Added test for Napi::Object::Set() method.

    Documentation

    • Added some clarifications for Napi::ClassPropertyDescriptor.
    • Added clarification about weak reference for Napi::ObjectWrap.
    • Some minor fixes all over the documentation.

    TOOL

    • Fixed eslint configuration.
    • Fixed CI configuration for Windows.
    • Enabled pre-commit ClangFormat on Windows.

    Commits

    • [f32db917f3] - Add test coverage for async contexts (#1164) (Jack)
    • [24455f88af] - src: check for tsfn in conditional_variable wait (Kevin Eady) #1168
    • [40ed7ce409] - src: fix regression introduced by #874 (Michael Dawson)
    • [9bea434326] - doc: added some comments to ClassPropertyDescriptor. (#1149) (Nicola Del Gobbo)
    • [57c212e15f] - buld: Enable running pre-commit ClangFormat on Win (Vladimir Morozov)
    • [8c46a9501a] - doc: clarify ObjectWrap weak ref behavior (#1155) (Alba Mendez)
    • [01274966d5] - build: run Windows CI only on nondeprecated build configurations (#1152) (Darshan Sen)
    • [b8449e17e0] - src: mark methods of wrapper classes const (Nikolai Vavilov) #874
    • [5e2c1f24f8] - lint: set sourceType to 'script' (#1141) (Anna Henningsen)
    • [da8af20152] - doc: mention Napi::Env arg for Finalization callback (#1139) (extremeheat)
    • [5b51864a39] - src: enable wrapping Napi namespace with custom namespace (#1135) (Anna Henningsen)
    • [c54aeef5fd] - Add Function::Call Napi::Value override (#1026) (rgerd)
    • [e906b5a7ce] - test: fix compilation problem on debian 8 (NickNaso) #1138
    • [5790c55784] - src: do not use non-static class member for constant value (#1134) (Anna Henningsen)
    • [b7659db945] - Merge pull request #1130 from meixg/main (Jack)
    • [a840d51d21] - Add test case for Object Set using uint32 as key (meixg)

    ... (truncated)

    Commits
    • e469ee6 Prepare release v5.0.0.
    • f32db91 Add test coverage for async contexts (#1164)
    • 24455f8 src: check for tsfn in conditional_variable wait
    • 40ed7ce src: fix regression introduced by #874
    • 9bea434 doc: added some comments to ClassPropertyDescriptor. (#1149)
    • 57c212e buld:Enable running pre-commit ClangFormat on Win
    • 8c46a95 doc: clarify ObjectWrap weak ref behavior (#1155)
    • 0127496 build: run Windows CI only on nondeprecated build configurations (#1152)
    • b8449e1 src: mark methods of wrapper classes const
    • 5e2c1f2 lint: set sourceType to 'script' (#1141)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • chore(deps-dev): bump @types/node from 16.11.41 to 18.0.0

    chore(deps-dev): bump @types/node from 16.11.41 to 18.0.0

    Bumps @types/node from 16.11.41 to 18.0.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • [Feature] There seems to be no bindings for

    [Feature] There seems to be no bindings for "ConstantArray"

    Which LLVM APIs do you want llvm-bindings to provide There seems to be no bindings for "ConstantArray", which is quite an important datatype since it's needed for most string implementations. Could it be added to the bindings or is there some issue preventing that?

    opened by wavpro 5
  • Inheritance not yet implemented

    Inheritance not yet implemented

    Due to the limitation of node-addon-api, this project has not implemented inheritance yet, so calling the method of superclass from subclass object will report an error, just like

    TypeError: Illegal invocation
    

    Related issues are discussed in the following two issues.

    node-addon-api#229 node-addon-api#956

    In order to temporarily solve this problem, I reexposed the superclass method that needs to be used on the subclass.

    It is expected that node-addon-api can really support inheritance.

    bug help wanted 
    opened by ApsarasX 3
Releases(v0.3.8)
  • v0.3.8(Jun 6, 2022)

  • v0.3.7(Apr 27, 2022)

  • v0.3.6(Mar 16, 2022)

  • v0.3.5(Mar 1, 2022)

  • v0.3.4(Feb 17, 2022)

    Breaking Changes

    • IR: change the signature of Module.print (9a68779)

    Bug Fixes

    • IR: return missing in Module.print (377b1d4)

    Features

    • Config: add LLVM Config Macro (825dc3c)
    • IR: add class GetElementPtrInst (cecd9fc)
    • IR: add class SelectInst (8fa33b6)
    • IR: add class VectorType and more instruction classes (30bcc1c)
    • IR: add duplicated getType for all subclasses of Value (2e2bfe8)
    • IR: add Module.getDataLayoutStr and DataLayout.getStringRepresentation (3cc8563)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.3(Dec 20, 2021)

  • v0.3.2(Dec 18, 2021)

    Bug Fixes

    • IR: the insertBB passed into DIBuilder.insertDeclare may be null (ea0760b)

    Features

    • IR: add DILexicalBlock and DIBuilder.createLexicalBlock (38519e0)
    • IR: add Module.ModFlagBehavior(enum) (2c4f1be)
    • IR: add some classes and methods related to debug information (7531651)
    • IR: supplement more classes and methods related to debug information (4314aaa)
    • IR: supplement some enums related to debug information (c08e087)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Nov 9, 2021)

  • v0.3.0(Oct 31, 2021)

  • v0.2.3(Oct 29, 2021)

    Bug Fixes

    • IR: add missing signature of IRBuilder.CreateResume (a1271cb)
    • IR: address transmission of InsertPoint's temporary object (a07a1fe)
    • IR: IRBuilder.SetInsertPoint typo (e2db57d)

    Features

    • IR: add class ConstantExpr (fbe662f)
    • IR: add ConstantExpr.getType (fb751eb)
    • IR: add DataLayout.getTypeAllocSize (18044f0)
    • IR: add Function.hasPersonalityFn, Function.setPersonalityFn and Function.setDoesNotThrow (6238bf6)
    • IR: add Function.insertInto, Function.removeFromParent and Function.eraseFromParent (43fda5c)
    • IR: add Intrinsic (403f747)
    • IR: add InvokeInst and IRBuilder.CreateInvoke (520f7a3)
    • IR: add IRBuilder.CreateInsertValue (6f60ded)
    • IR: add IRBuilder.InsertPoint, IRBuilder.saveIP, IRBuilder.saveAndClearIP and IRBuilder.restoreIP (4303af6)
    • IR: add LandingPadInst, IRBuilder.CreateExtractValue and IRBuilder.CreateLandingPad (2bd479a)
    • IR: add Module.getOrInsertFunction and FunctionCallee (693fdd5)
    • IR: add overloaded form of IRBuilder.CreateCall (1909cb8)
    • IR: add overloaded form of IRBuilder.CreateCall (d150d2c)
    • IR: add overloaded form of IRBuilder.CreateInvoke (815122d)
    • IR: add ResumeInst and IRBuilder.CreateResume (95358ad)
    • IR: add some duplicated methods of Type and Type.isSameType (0d6eabc)
    • IR: add StructType.get (7e27eee)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(Oct 15, 2021)

    Features

    • IR: add ConstantFP.getType (7c788b4)
    • IR: add ConstantFP.getType (8106c4e)
    • IR: add Function.deleteBody, Function.removeFromParent and Function.eraseFromParent (e7ad3bf)
    • IR: add Function.getNumUses and Function.removeDeadConstantUsers (a770a28)
    • IR: add GlobalVariable.removeFromParent and GlobalVariable.eraseFromParent (b625e09)
    • IR: add IntegerType.isIntegerTy (3effe47)
    • IR: add IRBuilder.CreateUnreachable (9d91aa6)
    • IR: add PointerType.isIntegerTy (75edd4f)
    • IR: add StructType.isIntegerTy (086e647)
    • IR: add SwitchInst (042c942)
    • IR: add UnreachableInst (ec9666a)
    • IR: add Value.user_empty, Function.use_empty and Function.user_empty (34ccfd7)
    • Linker: add Linker (71437ba)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Sep 29, 2021)

  • v0.2.0(May 24, 2021)

  • v0.1.8(May 24, 2021)

  • v0.1.7(Apr 20, 2021)

  • v0.1.6(Apr 13, 2021)

  • v0.1.5(Mar 30, 2021)

  • v0.1.4(Mar 29, 2021)

  • v0.1.3(Mar 29, 2021)

  • v0.1.2(Mar 28, 2021)

  • v0.1.1(Mar 28, 2021)

  • v0.1.0(Mar 28, 2021)

    Features

    • IR: add class Instruction and supplement several APIs of class BasicBlock (510973f)
    • IR: add IRBuilder.CreateGlobalString and IRBuilder.CreateGlobalStringPtr (02bb15c)
    • IR: add several instruction classes, include AllocaInst, BranchInst, CallInst, LoadInst, ReturnInst and StoreInst (8be97ad)
    • IR: make static 'New' functions of classes with subclasses more precise (b3bbb66)

    Performance Improvements

    • use HandleScope in right places (9f6953d)
    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Mar 27, 2021)

  • v0.0.2(Mar 26, 2021)

    Features

    • add Class Argument
    • add ConstantFP.getNaN
    • add Function.arg_size and Function.getArg
    • delete Class FunctionCallee
    • supplement more APIs of Class IRBuilder
    • add more test cases
    • add type signature for new APIs
    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Mar 26, 2021)

    This is the first release of llvm-bindings.

    And in this version, llvm-bindings has supported some of high frequency used APIs of LLVM.

    The specific classes and functions supported by the version are as follows:

    • ADT: APInt APFloat
    • Bitcode: writeBitcodeToFile
    • IR: LLVMContext Module Type IntegerType PointerType FunctionType StructType Value User Constant ConstantInt ConstantFP GlobalValue GlobalObject GlobalVariable Function BasicBlock FunctionCallee IRBuilder
    • Support: Target TargetRegistry.lookupTarget initializeAllTargetInfos initializeAllTargets initializeAllTargetMCs initializeAllAsmParsers initializeAllAsmPrinters
    • Target: TargetMachine
    Source code(tar.gz)
    Source code(zip)
Owner
ApsarasX
Web前端熟练工/编译器爱好者/安全刚入门 正在研究TypeScript的静态分析/代码审计 涉猎JavaScript/TypeScript/C++/LLVM WeChat: ApsarasX
ApsarasX
Convert Javascript/TypeScript to C

Convert Javascript/TypeScript to C

Andrei Markeev 1.1k Jun 27, 2022
StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that of JavaScript's and TypeScript's

StarkScript StarkScript - or the Stark programming language - is a compiled C-based programming language that aims to offer the same usability as that

EnderCommunity 5 May 10, 2022
Android Bindings for QuickJS, A fine little javascript engine.

quickjs-android quickjs-android 是 QuickJS JavaScript 引擎的 Android 接口框架,整体基于面向对象设计,提供了自动GC功能,使用简单。armeabi-v7a 的大小仅 350KB,是 Google V8 不错的替代品,启动速度比 V8 快,内

Wiki 91 Jun 9, 2022
This repository uses a ROS node to subscribe to camera (hikvision) and lidar (livox) data. After the node merges the data, it publishes the colored point cloud and displays it in rviz.

fusion-lidar-camera-ROS 一、介绍 本仓库是一个ROS工作空间,其中ws_fusion_camera/src有一个工具包color_pc ws_fusion_camera │ README.md │ └───src │ └───package: c

hongyu wang 14 Jun 15, 2022
Node.js bindings for the Mathematical Expression Toolkit

ExprTk.js This is the Node.js bindings for ExprTk (Github) by @ArashPartow ExprTk.js supports both synchronous and asynchronous background execution o

Momtchil Momtchev 5 Feb 18, 2022
A demo app using: Svelte, Typescript, Vite, and Emscripten

Svelte + TS + Vite + Emscripten This template should help get you started developing with Svelte, TypeScript, and Emscripten in Vite. This template wa

Wolf McNally 3 Nov 15, 2021
Collection of C++ containers extracted from LLVM

lvc lvc is a set of C++ containers extracted form LLVM for an easier integration in external projects. To avoid any potential conflit, the llvm namesp

Benjamin Navarro 26 Apr 22, 2022
Toy LLVM obfuscator pass

ToyObfuscator Some simple obfuscator ;) (base on llvm-10) Compile Build out-tree pass git clone https://github.com/veritas501/ToyObfuscator.git cd Toy

veritas501 38 Jun 14, 2022
VM devirtualization PoC based on AsmJit and llvm

vm_jit PoC vm devirtualization based on AsmJit. The binary was taken from YauzaCTF 2021 competition. You are welcome to try to solve it yourself, the

Pavel 44 Jun 10, 2022
Convert LLVM coverage information into HTML reports

llvm-coverage-to-html converter The clang compiler supports source based coverage tracking, but the default reporting options are very basic. This too

Thomas Neumann 2 Oct 11, 2021
A simple Jasper interpreter made with Flex, Bison and the LLVM IR

JasperCompiler A simple Jasper interpreter (for now) made with Flex and Bison. Jasper? Jasper is "a scripting language inspired by Haskell, Javascript

Emmanuel 2 Jan 16, 2022
Tobsterlang is a simple imperative programming language, written in C++ with LLVM.

tobsterlang Tobsterlang is a simple imperative programming language, written in C++ with LLVM. One of its distinct features is the fact it uses XML in

TOBSTERA 8 Nov 11, 2021
Writing a basic compiler frontend following LLVM's tutorial, with complete added supports Hindi and UTF-8 in general

सारस | SARAS Started with following LLVM's tutorial In development, a hobby project only JIT is broken right now, 'jit' branch par code hai uska Compi

Aditya Gupta 4 May 1, 2022
repo to house various LLVM based SIHFT passes for RISCV 32/64 soft error resilience

compas-ft-riscv COMPAS: Compiler-assisted Software-implemented Hardware Fault Tolerance implemented in LLVM passes for the RISC-V backend Repo to hous

EDA@TUM 2 Jan 10, 2022
pluggable tool to convert an unrolled TritonAST to LLVM-IR, optimize it and get back to TritonAST

it is fork from https://github.com/fvrmatteo/TritonASTLLVMIRTranslator *WARNINGS: tested only linux(ubuntu 20.04) and only llvm and clang version 10*

pr4gasm 5 Jun 10, 2022
Per function, Lua JIT using LLVM C++ toolchain

Lua Low Level Brief This is an alternative Lua (5.3.2) implementation that aims to archive better performance by generating native code with the help

Gabriel de Quadros Ligneul 10 Sep 4, 2021
LLVM IR and optimizer for shaders, including front-end adapters for GLSL and SPIR-V and back-end adapter for GLSL

Licensing LunarGLASS is available via a three clause BSD-style open source license. Goals The primary goals of the LunarGLASS project are: Reduce the

LunarG, Inc. 151 Jun 18, 2022
Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6

Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6. It is designed for microcontroller development. Instead of writing firmware code in C/C++, Elk allows to develop in JavaScript. Another use case is providing customers with a secure, protected scripting environment for product customisation.

Cesanta Software 1.4k Jun 27, 2022
JavaScript runtime for Fastly [email protected]

Fastly [email protected] JS Runtime The JS Compute Runtime for Fastly's [email protected] platform provides the environment JavaScript is executed in when using

Fastly 81 May 30, 2022