|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_1" [label="1: Start div0_struct_field\nFormals: v:X&\nLocals: \n DECLARE_LOCALS(&return); [line 24, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_1" -> "div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_4" ;
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_2" [label="2: Exit div0_struct_field \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_3" [label="3: Return Stmt \n n$0=*&v:X& [line 26, column 14]\n n$1=*n$0.field:int [line 26, column 14]\n *&return:int=(1 / n$1) [line 26, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_3" -> "div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_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
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&v:X& [line 25, column 3]\n *n$3.field:int=0 [line 25, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_4" -> "div0_struct_field#9739930445713322699.789b28ce09db76d69bc6373aefeacf6a_3" ;
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_1" [label="1: Start div0_template_field\nFormals: v:Container<int>&\nLocals: \n DECLARE_LOCALS(&return); [line 19, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_1" -> "div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_4" ;
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_2" [label="2: Exit div0_template_field \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_3" [label="3: Return Stmt \n n$0=*&v:Container<int>& [line 21, column 14]\n n$1=*n$0.field:int [line 21, column 14]\n *&return:int=(1 / n$1) [line 21, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_3" -> "div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_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
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_4" [label="4: BinaryOperatorStmt: Assign \n n$3=*&v:Container<int>& [line 20, column 3]\n *n$3.field:int=0 [line 20, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_4" -> "div0_template_field#16893301392201012428.8e63a0ece60a1b5e4e7b3cfa5d3dddd8_3" ;
|
|
|
|
}
|