-
-
Save Borgleader/1ef0fb45518e0be0d2d6 to your computer and use it in GitHub Desktop.
Typenames and syntax subject to change
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
uint8 foo() | |
{ | |
return 4; | |
} | |
void main() | |
{ | |
uint8 y = foo(); | |
} |
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
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