|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_1" [label="1: Start test\nFormals: \nLocals: a_ptr:A* \n DECLARE_LOCALS(&return,&a_ptr); [line 20, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_1" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_4" ;
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_2" [label="2: Exit test \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
[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
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" [label="3: Call _fun_A_fun \n n$1=*&a_ptr:A* [line 24, column 3]\n _=*n$1:A [line 24, column 3]\n n$3=_fun_A_fun(n$1:A*,1:int,2:int,3:int) [line 24, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_2" ;
|
[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
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_4" [label="4: Call _fun_A_fun \n n$4=*&a_ptr:A* [line 23, column 3]\n _=*n$4:A [line 23, column 3]\n n$6=_fun_A_fun(n$4:A*,1:int,2:int) [line 23, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_4" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" ;
|
|
|
|
"fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_1" [label="1: Start A_fun\nFormals: this:A* a:int b:int c:int\nLocals: \n DECLARE_LOCALS(&return); [line 16, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_1" -> "fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_3" ;
|
|
|
|
"fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_2" [label="2: Exit A_fun \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_3" [label="3: Return Stmt \n n$0=*&a:int [line 16, column 42]\n n$1=*&b:int [line 16, column 46]\n n$2=*&c:int [line 16, column 50]\n *&return:int=((n$0 + n$1) + n$2) [line 16, column 35]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_3" -> "fun#A#(11837362180710022838).bd816a84384ccf9d60cef41667a13288_2" ;
|
|
|
|
"fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_1" [label="1: Start A_fun\nFormals: this:A* a:int b:int\nLocals: \n DECLARE_LOCALS(&return); [line 18, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_1" -> "fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_3" ;
|
|
|
|
"fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_2" [label="2: Exit A_fun \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_3" [label="3: Return Stmt \n n$0=*&a:int [line 18, column 35]\n n$1=*&b:int [line 18, column 39]\n *&return:int=(n$0 - n$1) [line 18, column 28]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_3" -> "fun#A#(8182299831707963163).ce97257c1f3f892cff78d992a175b48a_2" ;
|
|
|
|
}
|