-
-
Save proywm/a8c47bc8b863a782d4201499f2aae2a1 to your computer and use it in GitHub Desktop.
CustomPragma__IR_code_generation__Banckend_pass
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
//clang -Xclang -ast-dump example.c | |
-FunctionDecl 0x5630129ef6a8 <line:6:1, line:16:1> line:6:5 main 'int ()' | |
| `-CompoundStmt 0x5630129f0fc0 <col:12, line:16:1> | |
| |-DeclStmt 0x5630129ef8a8 <line:7:2, col:23> | |
| | `-VarDecl 0x5630129ef760 <col:2, col:22> col:6 used c1 'int' cinit | |
| | `-CallExpr 0x5630129ef878 <col:11, col:22> 'int' | |
| | |-ImplicitCastExpr 0x5630129ef860 <col:11> 'int (*)(int, int)' <FunctionToPointerDecay> | |
| | | `-DeclRefExpr 0x5630129ef7c8 <col:11> 'int (int, int)' Function 0x5630129ef3b8 'foo1' 'int (int, int)' | |
| | |-IntegerLiteral 0x5630129ef7e8 <col:16> 'int' 50 | |
| | `-IntegerLiteral 0x5630129ef808 <col:20> 'int' 90 | |
| |-DeclStmt 0x5630129efa60 <line:8:2, col:14> | |
| | |-VarDecl 0x5630129ef8d8 <col:2, col:6> col:6 used a 'int' | |
| | |-VarDecl 0x5630129ef958 <col:2, col:9> col:9 used b 'int' | |
| | `-VarDecl 0x5630129ef9d8 <col:2, col:12> col:12 used c2 'int' | |
| |-BinaryOperator 0x5630129efab8 <line:9:2, col:6> 'int' '=' | |
| | |-DeclRefExpr 0x5630129efa78 <col:2> 'int' lvalue Var 0x5630129ef8d8 'a' 'int' | |
| | `-IntegerLiteral 0x5630129efa98 <col:6> 'int' 7 | |
| |-BinaryOperator 0x5630129efb18 <line:10:2, col:6> 'int' '=' | |
| | |-DeclRefExpr 0x5630129efad8 <col:2> 'int' lvalue Var 0x5630129ef958 'b' 'int' | |
| | `-IntegerLiteral 0x5630129efaf8 <col:6> 'int' 5 | |
| |-AttributedStmt 0x5630129efcc8 <line:11:1, line:12:16> | |
| | |-MyCustomAttr 0x5630129efc90 <line:11:9, col:38> Implicit Call foo foo2 | |
| | `-BinaryOperator 0x5630129efc70 <line:12:2, col:16> 'int' '=' | |
| | |-DeclRefExpr 0x5630129efb78 <col:2> 'int' lvalue Var 0x5630129ef9d8 'c2' 'int' | |
| | `-CallExpr 0x5630129efc10 <col:7, col:16> 'int' | |
| | |-ImplicitCastExpr 0x5630129efbf8 <col:7> 'int (*)(int, int)' <FunctionToPointerDecay> | |
| | | `-DeclRefExpr 0x5630129efb98 <col:7> 'int (int, int)' Function 0x5630129ef5a0 'foo2' 'int (int, int)' | |
| | |-ImplicitCastExpr 0x5630129efc40 <col:12> 'int' <LValueToRValue> | |
| | | `-DeclRefExpr 0x5630129efbb8 <col:12> 'int' lvalue Var 0x5630129ef8d8 'a' 'int' | |
| | `-ImplicitCastExpr 0x5630129efc58 <col:15> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129efbd8 <col:15> 'int' lvalue Var 0x5630129ef958 'b' 'int' | |
| |-CallExpr 0x5630129efde8 <line:13:2, col:26> 'int' | |
| | |-ImplicitCastExpr 0x5630129efdd0 <col:2> 'int (*)(const char *, ...)' <FunctionToPointerDecay> | |
| | | `-DeclRefExpr 0x5630129efce0 <col:2> 'int (const char *, ...)' Function 0x5630129dec58 'printf' 'int (const char *, ...)' | |
| | |-ImplicitCastExpr 0x5630129efe30 <col:9> 'const char *' <NoOp> | |
| | | `-ImplicitCastExpr 0x5630129efe18 <col:9> 'char *' <ArrayToPointerDecay> | |
| | | `-StringLiteral 0x5630129efd40 <col:9> 'char [11]' lvalue "C1 is: %d\n" | |
| | `-ImplicitCastExpr 0x5630129efe48 <col:24> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129efd68 <col:24> 'int' lvalue Var 0x5630129ef760 'c1' 'int' | |
| |-CallExpr 0x5630129efef8 <line:14:2, col:26> 'int' | |
| | |-ImplicitCastExpr 0x5630129efee0 <col:2> 'int (*)(const char *, ...)' <FunctionToPointerDecay> | |
| | | `-DeclRefExpr 0x5630129efe60 <col:2> 'int (const char *, ...)' Function 0x5630129dec58 'printf' 'int (const char *, ...)' | |
| | |-ImplicitCastExpr 0x5630129eff40 <col:9> 'const char *' <NoOp> | |
| | | `-ImplicitCastExpr 0x5630129eff28 <col:9> 'char *' <ArrayToPointerDecay> | |
| | | `-StringLiteral 0x5630129efe80 <col:9> 'char [11]' lvalue "C2 is: %d\n" | |
| | `-ImplicitCastExpr 0x5630129eff58 <col:24> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129efea8 <col:24> 'int' lvalue Var 0x5630129ef9d8 'c2' 'int' | |
| `-ReturnStmt 0x5630129eff90 <line:15:2, col:9> | |
| `-IntegerLiteral 0x5630129eff70 <col:9> 'int' 0 | |
|-FunctionDecl 0x5630129f1148 prev 0x5630129ef3b8 <line:18:1, line:25:1> line:18:5 used foo1 'int (int, int)' | |
| |-ParmVarDecl 0x5630129f1028 <col:10, col:14> col:14 used a 'int' | |
| |-ParmVarDecl 0x5630129f10a8 <col:17, col:21> col:21 used b 'int' | |
| `-CompoundStmt 0x5630129f15e8 <col:24, line:25:1> | |
| |-DeclStmt 0x5630129f1278 <line:19:2, col:7> | |
| | `-VarDecl 0x5630129f1210 <col:2, col:6> col:6 used c 'int' | |
| |-BinaryOperator 0x5630129f1340 <line:20:2, col:10> 'int' '=' | |
| | |-DeclRefExpr 0x5630129f1290 <col:2> 'int' lvalue Var 0x5630129f1210 'c' 'int' | |
| | `-BinaryOperator 0x5630129f1320 <col:6, col:10> 'int' '+' | |
| | |-ImplicitCastExpr 0x5630129f12f0 <col:6> 'int' <LValueToRValue> | |
| | | `-DeclRefExpr 0x5630129f12b0 <col:6> 'int' lvalue ParmVar 0x5630129f1028 'a' 'int' | |
| | `-ImplicitCastExpr 0x5630129f1308 <col:10> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129f12d0 <col:10> 'int' lvalue ParmVar 0x5630129f10a8 'b' 'int' | |
| |-ForStmt 0x5630129f1568 <line:21:5, line:23:2> | |
| | |-DeclStmt 0x5630129f1400 <line:21:10, col:17> | |
| | | `-VarDecl 0x5630129f1378 <col:10, col:16> col:14 used i 'int' cinit | |
| | | `-IntegerLiteral 0x5630129f13e0 <col:16> 'int' 0 | |
| | |-<<<NULL>>> | |
| | |-BinaryOperator 0x5630129f1470 <col:19, col:23> 'int' '<' | |
| | | |-ImplicitCastExpr 0x5630129f1458 <col:19> 'int' <LValueToRValue> | |
| | | | `-DeclRefExpr 0x5630129f1418 <col:19> 'int' lvalue Var 0x5630129f1378 'i' 'int' | |
| | | `-IntegerLiteral 0x5630129f1438 <col:23> 'int' 10 | |
| | |-UnaryOperator 0x5630129f14b0 <col:27, col:28> 'int' postfix '++' | |
| | | `-DeclRefExpr 0x5630129f1490 <col:27> 'int' lvalue Var 0x5630129f1378 'i' 'int' | |
| | `-CompoundStmt 0x5630129f1550 <col:31, line:23:2> | |
| | `-CompoundAssignOperator 0x5630129f1520 <line:22:6, col:11> 'int' '+=' ComputeLHSTy='int' ComputeResultTy='int' | |
| | |-DeclRefExpr 0x5630129f14c8 <col:6> 'int' lvalue Var 0x5630129f1210 'c' 'int' | |
| | `-ImplicitCastExpr 0x5630129f1508 <col:11> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129f14e8 <col:11> 'int' lvalue Var 0x5630129f1378 'i' 'int' | |
| `-ReturnStmt 0x5630129f15d8 <line:24:2, col:9> | |
| `-ImplicitCastExpr 0x5630129f15c0 <col:9> 'int' <LValueToRValue> | |
| `-DeclRefExpr 0x5630129f15a0 <col:9> 'int' lvalue Var 0x5630129f1210 'c' 'int' | |
`-FunctionDecl 0x5630129f1750 prev 0x5630129ef5a0 <line:27:1, line:34:1> line:27:5 used foo2 'int (int, int)' | |
|-ParmVarDecl 0x5630129f1630 <col:10, col:14> col:14 used a 'int' | |
|-ParmVarDecl 0x5630129f16b0 <col:17, col:21> col:21 used b 'int' | |
`-CompoundStmt 0x5630129f1c20 <col:24, line:34:1> | |
|-DeclStmt 0x5630129f1880 <line:28:2, col:7> | |
| `-VarDecl 0x5630129f1818 <col:2, col:6> col:6 used c 'int' | |
|-BinaryOperator 0x5630129f1948 <line:29:2, col:10> 'int' '=' | |
| |-DeclRefExpr 0x5630129f1898 <col:2> 'int' lvalue Var 0x5630129f1818 'c' 'int' | |
| `-BinaryOperator 0x5630129f1928 <col:6, col:10> 'int' '-' | |
| |-ImplicitCastExpr 0x5630129f18f8 <col:6> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129f18b8 <col:6> 'int' lvalue ParmVar 0x5630129f1630 'a' 'int' | |
| `-ImplicitCastExpr 0x5630129f1910 <col:10> 'int' <LValueToRValue> | |
| `-DeclRefExpr 0x5630129f18d8 <col:10> 'int' lvalue ParmVar 0x5630129f16b0 'b' 'int' | |
|-ForStmt 0x5630129f1ba0 <line:30:2, line:32:4> | |
| |-DeclStmt 0x5630129f1a08 <line:30:7, col:14> | |
| | `-VarDecl 0x5630129f1980 <col:7, col:13> col:11 used i 'int' cinit | |
| | `-IntegerLiteral 0x5630129f19e8 <col:13> 'int' 0 | |
| |-<<<NULL>>> | |
| |-BinaryOperator 0x5630129f1a78 <col:16, col:20> 'int' '<' | |
| | |-ImplicitCastExpr 0x5630129f1a60 <col:16> 'int' <LValueToRValue> | |
| | | `-DeclRefExpr 0x5630129f1a20 <col:16> 'int' lvalue Var 0x5630129f1980 'i' 'int' | |
| | `-IntegerLiteral 0x5630129f1a40 <col:20> 'int' 5 | |
| |-UnaryOperator 0x5630129f1ab8 <col:23, col:24> 'int' postfix '++' | |
| | `-DeclRefExpr 0x5630129f1a98 <col:23> 'int' lvalue Var 0x5630129f1980 'i' 'int' | |
| `-CompoundStmt 0x5630129f1b88 <col:27, line:32:4> | |
| `-BinaryOperator 0x5630129f1b68 <line:31:6, col:14> 'int' '=' | |
| |-DeclRefExpr 0x5630129f1ad0 <col:6> 'int' lvalue Var 0x5630129f1818 'c' 'int' | |
| `-BinaryOperator 0x5630129f1b48 <col:10, col:14> 'int' '*' | |
| |-ImplicitCastExpr 0x5630129f1b30 <col:10> 'int' <LValueToRValue> | |
| | `-DeclRefExpr 0x5630129f1af0 <col:10> 'int' lvalue Var 0x5630129f1818 'c' 'int' | |
| `-IntegerLiteral 0x5630129f1b10 <col:14> 'int' 2 | |
`-ReturnStmt 0x5630129f1c10 <line:33:2, col:9> | |
`-ImplicitCastExpr 0x5630129f1bf8 <col:9> 'int' <LValueToRValue> | |
`-DeclRefExpr 0x5630129f1bd8 <col:9> 'int' lvalue Var 0x5630129f1818 'c' 'int' |
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
#include <stdio.h> | |
int foo1(int a, int b); | |
int foo2(int a, int b); | |
int main() { | |
int c1 = foo1(50, 90); | |
int a, b, c2; | |
a = 7; | |
b = 5; | |
#pragma MyCustomAttr call ( foo, foo2 ) | |
c2 = foo2(a, b); | |
printf("C1 is: %d\n", c1); | |
printf("C2 is: %d\n", c2); | |
return 0; | |
} | |
int foo1(int a, int b) { | |
int c; | |
c = a + b; | |
for (int i=0; i < 10; i++){ | |
c += i; | |
} | |
return c; | |
} | |
int foo2(int a, int b) { | |
int c; | |
c = a - b; | |
for (int i=0; i < 5; i++){ | |
c = c * 2; | |
} | |
return c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment