|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" [label="1: Start main\nFormals: \nLocals: X:int y:int \n DECLARE_LOCALS(&return,&X,&y); [line 10, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" -> "main.fad58de7366495db4650cfefac2fcd61_7" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: Return Stmt \n *&return:int=0 [line 17, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" [label="4: Fallback node \n n$0=*&X:int [line 15, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" -> "main.fad58de7366495db4650cfefac2fcd61_6" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" [label="5: DeclStmt \n *&X:int=4 [line 14, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_6" [label="6: BinaryOperatorStmt: Assign \n *&y:int=n$0 [line 13, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_6" -> "main.fad58de7366495db4650cfefac2fcd61_3" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_7" [label="7: DeclStmt \n *&y:int=3 [line 11, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_7" -> "main.fad58de7366495db4650cfefac2fcd61_5" ;
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_1" [label="1: Start test\nFormals: p:int*\nLocals: y:int x:int \n DECLARE_LOCALS(&return,&y,&x); [line 20, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_1" -> "test.098f6bcd4621d373cade4e832627b4f6_5" ;
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_2" [label="2: Exit test \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_3" [label="3: BinaryOperatorStmt: Add \n n$0=*&x:int [line 24, column 5]\n n$1=*&y:int [line 24, column 9]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_3" -> "test.098f6bcd4621d373cade4e832627b4f6_6" ;
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_4" [label="4: DeclStmt \n *&y:int=1 [line 23, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_4" -> "test.098f6bcd4621d373cade4e832627b4f6_3" ;
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_5" [label="5: DeclStmt \n n$2=*&p:int* [line 22, column 14]\n n$3=*n$2:int [line 22, column 13]\n *&x:int=n$3 [line 22, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_5" -> "test.098f6bcd4621d373cade4e832627b4f6_4" ;
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_6" [label="6: Return Stmt \n *&return:int=(n$0 + n$1) [line 21, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test.098f6bcd4621d373cade4e832627b4f6_6" -> "test.098f6bcd4621d373cade4e832627b4f6_2" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_1" [label="1: Start with_conditional\nFormals: p:int*\nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$0:int x:int \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$0,&x); [line 28, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_1" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_9" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_2" [label="2: Exit with_conditional \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_3" [label="3: + \n " ]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_3" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_8" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_4" [label="4: Prune (true branch, boolean exp) \n n$1=*&p:int* [line 31, column 5]\n PRUNE(n$1, true); [line 31, column 5]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_4" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_6" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_5" [label="5: Prune (false branch, boolean exp) \n n$1=*&p:int* [line 31, column 5]\n PRUNE(!n$1, false); [line 31, column 5]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_5" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_7" ;
|
[clang] enforce that `instruction` always returns one SIL expression
Summary:
Previously, the type of `trans_result` contained a list of SIL expressions.
However, most of the time we expect to get exactly one, and getting a different
number is a soft(!) error, usually returning `-1`.
This splits `trans_result` into `control`, which contains the information
needed for temporary computation (hence when we don't necessarily know the
return value yet), and a new version of `trans_result` that includes `control`,
the previous `exps` list but replaced by a single `return` expression instead,
and a couple other values that made sense to move out of `control`. This allows
some flexibility in the frontend compared to enforcing exactly one return
expression always: if they are not known yet we stick to `control` instead (see
eg `compute_controls_to_parent`).
This creates more garbage temporary identifiers, however they do not show up in
the final cfg. Instead, we see that temporary IDs are now often not
consecutive...
The most painful complication is in the treatment of `DeclRefExpr`, which was
actually returning *two* expressions: the method name and the `this` object.
Now the method name is a separate (optional) field in `trans_result`.
Reviewed By: mbouaziz
Differential Revision: D7881088
fbshipit-source-id: 41ad3b5
7 years ago
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_6" [label="6: ConditionalStmt Branch \n n$2=*&p:int* [line 31, column 10]\n n$3=*n$2:int [line 31, column 9]\n n$4=*&x:int [line 31, column 14]\n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int=(n$3 + n$4) [line 31, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_6" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_3" ;
|
[clang] enforce that `instruction` always returns one SIL expression
Summary:
Previously, the type of `trans_result` contained a list of SIL expressions.
However, most of the time we expect to get exactly one, and getting a different
number is a soft(!) error, usually returning `-1`.
This splits `trans_result` into `control`, which contains the information
needed for temporary computation (hence when we don't necessarily know the
return value yet), and a new version of `trans_result` that includes `control`,
the previous `exps` list but replaced by a single `return` expression instead,
and a couple other values that made sense to move out of `control`. This allows
some flexibility in the frontend compared to enforcing exactly one return
expression always: if they are not known yet we stick to `control` instead (see
eg `compute_controls_to_parent`).
This creates more garbage temporary identifiers, however they do not show up in
the final cfg. Instead, we see that temporary IDs are now often not
consecutive...
The most painful complication is in the treatment of `DeclRefExpr`, which was
actually returning *two* expressions: the method name and the `this` object.
Now the method name is a separate (optional) field in `trans_result`.
Reviewed By: mbouaziz
Differential Revision: D7881088
fbshipit-source-id: 41ad3b5
7 years ago
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_7" [label="7: ConditionalStmt Branch \n n$5=*&x:int [line 31, column 18]\n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int=n$5 [line 31, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_7" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_3" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_8" [label="8: Fallback node \n n$6=*&0$?%__sil_tmpSIL_temp_conditional___n$0:int [line 31, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_8" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_10" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_9" [label="9: DeclStmt \n *&x:int=1 [line 30, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_9" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_4" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_9" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_5" ;
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_10" [label="10: Return Stmt \n *&return:int=n$6 [line 29, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_10" -> "with_conditional.c7f3381cc5bd6cfe19bc60c013ae8f1c_2" ;
|
|
|
|
}
|