This repository has been archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First Blood * Add postfix unary * Fix imports * Fix
- Loading branch information
Showing
19 changed files
with
7,612 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,5 @@ typings/ | |
|
||
# next.js build output | ||
.next | ||
|
||
/examples/foo.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# Minits | ||
TypeScript to LLVM compiler | ||
# minits | ||
|
||
Typescript with LLVM backend. | ||
|
||
``` | ||
$ npm install | ||
$ npm start | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function main(): number { | ||
let a: number = 0; | ||
a++; | ||
a++; | ||
a--; | ||
return a; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as argv from "commander"; | ||
import * as llvm from "llvm-node"; | ||
import * as ts from "typescript"; | ||
|
||
function main() { | ||
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(); | ||
console.log(ll); | ||
llvm.writeBitcodeToFile(module, "/tmp/out.bc"); | ||
} | ||
|
||
main() |
Oops, something went wrong.