Last active
August 29, 2015 14:04
-
-
Save antonijn/9c0d7f2935208d82bb9a to your computer and use it in GitHub Desktop.
Antonijn Intermediate Representation (AIR)
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
global int @i = inline { | |
%0 = add int 5, int 3 | |
%1 = add int %0, int 1 | |
} int %1 | |
global int @main(int %argc, char** %argv) { | |
%0 = alloca int | |
%1 = alloca char** | |
%2 = alloca int | |
store int* %0, int %argc | |
store char*** %1, char** %argv | |
%3 = load int* @i | |
%4 = load int* %0 | |
%5 = add int %3, int %4 | |
%6 = add int %5, int 5 | |
store int* %2, int %6 | |
%7 = load int* %2 | |
ret int %7 | |
} |
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
int i = 5 + 3 + 1; | |
int main(int argc, char *argv[]) | |
{ | |
int a = i + argc + 4; | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment