Skip to content

Instantly share code, notes, and snippets.

@Borgleader

Borgleader/Input Secret

Created November 28, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Borgleader/1ef0fb45518e0be0d2d6 to your computer and use it in GitHub Desktop.
Save Borgleader/1ef0fb45518e0be0d2d6 to your computer and use it in GitHub Desktop.
Typenames and syntax subject to change
uint8 foo()
{
return 4;
}
void main()
{
uint8 y = foo();
}
borgleader@Holodeck:~/Bitbucket/bolt$ ./bin/bolt samples/sample1.bolt
bolt LLVM compiler
Parse successful.
Semantic analysis successful.
AST processed.
; ModuleID = 'module jit'
define i8 @foo() {
entrypoint:
%trunc = trunc i32 4 to i8
ret i8 %trunc
}
define void @main() {
entrypoint:
%y = alloca i8
%0 = call i8 @foo()
store i8 %0, i8* %y
ret void
}
Code generation successful.
Quitting...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment