|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_1" [label="1: Start div0_class\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 17, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_1" -> "div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_3" ;
|
|
|
|
"div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_2" [label="2: Exit div0_class \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
|
|
|
"div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_3" [label="3: Call _fun_A_fun \n n$2=_fun_A_fun(0:int) [line 17, column 21]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_3" -> "div0_class#4984704850372216251.260ce38d809793fc3e38787f8d1eb4d6_2" ;
|
|
|
|
"div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_1" [label="1: Start div0_instance\nFormals: a:A*\nLocals: \n DECLARE_LOCALS(&return); [line 19, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_1" -> "div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_3" ;
|
|
|
|
"div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_2" [label="2: Exit div0_instance \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
|
|
|
"div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_3" [label="3: Call _fun_A_fun \n n$1=*&a:A* [line 21, column 3]\n n$3=_fun_A_fun(0:int) [line 21, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_3" -> "div0_instance#13376949534750090437.51640b59fd921707822fcc45f2fde64d_2" ;
|
|
|
|
"fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_1" [label="1: Start A_fun\nFormals: a:int\nLocals: \n DECLARE_LOCALS(&return); [line 15, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_1" -> "fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_3" ;
|
|
|
|
"fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_2" [label="2: Exit A_fun \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_3" [label="3: Return Stmt \n n$0=*&a:int [line 15, column 32]\n *&return:int=(1 / n$0) [line 15, column 21]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_3" -> "fun#A#(6769534270530582672).0ab578f4190d39d2c1b23c6d46a310c6_2" ;
|
|
|
|
}
|