|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_1" [label="1: Start test\nFormals: \nLocals: a_ptr:A* \n DECLARE_LOCALS(&return,&a_ptr); [line 23, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_1" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" ;
|
|
|
|
"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_method \n n$1=*&a_ptr:A* [line 25, column 3]\n _=*n$1:A [line 25, column 3]\n n$3=_fun_A_method(n$1:A*) [line 25, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_2" ;
|
|
|
|
"init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_1" [label="1: Start A_init\nFormals: this:A* val:int\nLocals: \n DECLARE_LOCALS(&return); [line 14, column 3]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_1" -> "init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_3" ;
|
|
|
|
"init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_2" [label="2: Exit A_init \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
|
|
|
"init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_3" [label="3: BinaryOperatorStmt: Assign \n n$1=*&this:A* [line 14, column 24]\n n$2=*&val:int [line 14, column 32]\n *n$1.field:int=n$2 [line 14, column 24]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_3" -> "init#A#(11888841587519675340).79bf6a1702f6a90708acc2d560532750_2" ;
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_1" [label="1: Start A_method\nFormals: this:A*\nLocals: \n DECLARE_LOCALS(&return); [line 18, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_1" -> "method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_4" ;
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_2" [label="2: Exit A_method \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_3" [label="3: Return Stmt \n n$0=*&this:A* [line 20, column 10]\n n$1=*n$0.field:int [line 20, column 10]\n *&return:int=n$1 [line 20, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_3" -> "method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_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
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_4" [label="4: Call _fun_A_init \n n$3=*&this:A* [line 19, column 3]\n _=*n$3:A [line 19, column 3]\n n$5=_fun_A_init(n$3:A*,10:int) [line 19, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_4" -> "method#A#(5340410962252776012).be8cb65bc6e38d687825fbc80265a66c_3" ;
|
|
|
|
}
|