Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created April 28, 2010 21:40
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 ashgti/382765 to your computer and use it in GitHub Desktop.
Save ashgti/382765 to your computer and use it in GitHub Desktop.
@0 = internal constant [11 x i8] c"&infix:<+>\00" ; <[11 x i8]*> [#uses=1]
@1 = internal constant [4 x i8] c"say\00" ; <[4 x i8]*> [#uses=1]
declare i8* @construct_int(i64)
declare i8* @vm_stack_push()
declare i8* @vm_stack_pop()
declare i8* @vm_stack_top()
declare i8* @vm_dispatch_sub(...)
define internal void @main() {
entry:
%a = alloca i8* ; <i8**> [#uses=2]
%0 = call i8* @construct_int(i64 5) ; <i8*> [#uses=1]
%1 = call i8* @construct_int(i64 3) ; <i8*> [#uses=1]
%2 = call i8* (...)* @vm_dispatch_sub([11 x i8]* @0, i64 2, i8* %0, i8* %1) ; <i8*> [#uses=1]
store i8* %2, i8** %a
%3 = load i8** %a ; <i8*> [#uses=1]
%4 = call i8* (...)* @vm_dispatch_sub([4 x i8]* @1, i64 1, i8* %3) ; <i8*> [#uses=0]
ret void
}
my $a := 5 + 3;
say($a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment