Skip to content

dvoytenko/typescript-llvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Dima Voytenko
Jan 19, 2023
944907f · Jan 19, 2023

History

57 Commits
Jan 19, 2023
Oct 14, 2022
Oct 14, 2022
Aug 10, 2022
Jul 30, 2022
Jul 8, 2022
Aug 10, 2022
Jul 30, 2022
Oct 14, 2022
Oct 14, 2022
Oct 14, 2022
Aug 14, 2022
Oct 14, 2022
Aug 17, 2022
Oct 14, 2022
Aug 10, 2022

Repository files navigation

Typescript to LLVM Compiler

To get started

  1. Ensure clang is installed.
  2. Install LLVM.
  3. Install WABT.
  4. Run npm install.

To run

npm install
npm run test

Known issues

  1. I had to patch llvm-bindings in a few places. Not all of them have been released yet. E.g. see ApsarasX/llvm-bindings#23.

Some common commands

Assembly to bitcode:

llvm-as x.ll
ls -l x.bc

To compile .ll to machine code:

llc x.ll -filetype=obj
gcc x.o
./a.out

To run optimizer:

opt -Oz -S -o x.Oz.ll x.ll
# --metarenamer - rename everything

To WASM:

llc -mtriple=wasm32-unknown-unknown -O3 -filetype=obj one.ll -o one.o
wasm-ld one.o -o one.wasm -allow-undefined --entry "main"

To see WAT (see wabt):

wasm2wat -o one.wat one.wasm

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published