Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * If + wypisanie
- ** C
- int puts(char*, int);
- int getchar();
- int main(){
- char* ret;
- if(getchar() == 32)
- ret = "spacja";
- else
- ret = "inny klawisz";
- puts(ret, 1);
- return 0;
- }
- ** IR
- ; ModuleID = "/home/maxmati/src/2017/maxmati/parser2/main.py"
- target triple = ""
- target datalayout = ""
- {
- entry:
- entry.if:
- br label %"entry.endif"
- entry.else:
- br label %"entry.endif"
- entry.endif:
- }
- ** explained
- ; ModuleID = "/home/maxmati/src/2017/maxmati/parser2/main.py"
- target triple = ""
- target datalayout = ""
- int puts(char*, int);
- int getchar();
- int main(){
- {
- entry:
- char* ret;
- if(getchar() == 32)
- entry.if:
- ret = "spacja";
- br label %"entry.endif"
- entry.else:
- ret = "inny klawisz";
- br label %"entry.endif"
- entry.endif:
- puts(ret, 1);
- return 0;
- }
- "spacja"
- "inny klawisz"
- * funkcje
- ** C
- int test(int a, int b){
- int c;
- c = a * b;
- return c + 2;
- }
- int main(){
- int a;
- int b;
- b = 15;
- a = test(b, 10)
- return a;
- }
- ** IR
- target triple = ""
- target datalayout = ""
- {
- entry:
- }
- {
- entry:
- }
- ** explained
- target triple = ""
- target datalayout = ""
- int test(int a, int b){
- {
- entry:
- int c;
- c = a * b;
- return c + 2;
- }
- int main(){
- {
- entry:
- int a;
- int b;
- b = 15;
- a = test(b, 10)
- return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement