|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_1" [label="1: Start foo\nFormals: a:A*\nLocals: \n DECLARE_LOCALS(&return); [line 54, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_1" -> "foo.acbd18db4cc2f85cedef654fccc4a4d8_4" ;
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_2" [label="2: Exit foo \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_3" [label="3: Return Stmt \n n$0=*&a:A* [line 58, column 10]\n *&return:A*=n$0 [line 58, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_3" -> "foo.acbd18db4cc2f85cedef654fccc4a4d8_2" ;
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_4" [label="4: Message Call: capture \n n$1=*&a:A* [line 56, column 4]\n n$2=_fun_A_capture(n$1:A*) virtual [line 56, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"foo.acbd18db4cc2f85cedef654fccc4a4d8_4" -> "foo.acbd18db4cc2f85cedef654fccc4a4d8_3" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" [label="1: Start main\nFormals: argc:int argv:char const **\nLocals: a:A* \n DECLARE_LOCALS(&return,&a); [line 61, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" -> "main.fad58de7366495db4650cfefac2fcd61_5" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: Return Stmt \n *&return:int=0 [line 67, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" [label="4: BinaryOperatorStmt: Assign \n n$0=*&a:A* [line 65, column 11]\n n$1=_fun_foo(n$0:A*) [line 65, column 7]\n *&a:A*=n$1 [line 65, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" -> "main.fad58de7366495db4650cfefac2fcd61_3" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" [label="5: DeclStmt \n n$2=_fun___objc_alloc_no_fail(sizeof(t=A):unsigned long) [line 63, column 10]\n *&a:A*=n$2 [line 63, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
|
|
|
"objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_1" [label="1: Start objc_blockA_capture_1\nFormals: self:A* d:D*\nLocals: \nCaptured: self:A* \n DECLARE_LOCALS(&return); [line 47, column 16]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_1" -> "objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_3" ;
|
|
|
|
"objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_2" [label="2: Exit objc_blockA_capture_1 \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
|
|
|
"objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_3" [label="3: BinaryOperatorStmt: Assign \n n$1=*&self:A* [line 48, column 5]\n n$2=*&d:D* [line 48, column 13]\n *n$1._data:D*=n$2 [line 48, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_3" -> "objc_blockA_capture_1.6fdcfe58244de8603cec62dad07f2ae4_2" ;
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_1" [label="1: Start A_capture\nFormals: self:A*\nLocals: \n DECLARE_LOCALS(&return); [line 45, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_1" -> "capture#A#instance.d411336575e4bf632a1828f5f5979726_4" ;
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_2" [label="2: Exit A_capture \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
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_3" [label="3: Message Call: sHandler: \n n$3=*&self:A* [line 47, column 4]\n n$4=*n$3._b:B* [line 47, column 4]\n n$0=*&self:A* [line 47, column 16]\n n$5=_fun_B_sHandler:(n$4:B*,(_fun_objc_blockA_capture_1,(n$0 &self:A*)):_fn_(*)) virtual block_params [line 47, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_3" -> "capture#A#instance.d411336575e4bf632a1828f5f5979726_2" ;
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_4" [label="4: BinaryOperatorStmt: Assign \n n$6=*&self:A* [line 46, column 3]\n n$7=_fun___objc_alloc_no_fail(sizeof(t=B):unsigned long) [line 46, column 8]\n *n$6._b:B*=n$7 [line 46, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"capture#A#instance.d411336575e4bf632a1828f5f5979726_4" -> "capture#A#instance.d411336575e4bf632a1828f5f5979726_3" ;
|
|
|
|
"sHandler:#B#instance.590685250eb38eaab242405cd45c572b_1" [label="1: Start B_sHandler:\nFormals: self:B* h:_fn_(*)\nLocals: \n DECLARE_LOCALS(&return); [line 28, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"sHandler:#B#instance.590685250eb38eaab242405cd45c572b_1" -> "sHandler:#B#instance.590685250eb38eaab242405cd45c572b_3" ;
|
|
|
|
"sHandler:#B#instance.590685250eb38eaab242405cd45c572b_2" [label="2: Exit B_sHandler: \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"sHandler:#B#instance.590685250eb38eaab242405cd45c572b_3" [label="3: BinaryOperatorStmt: Assign \n n$0=*&self:B* [line 30, column 3]\n n$1=*&h:_fn_(*) [line 30, column 14]\n *n$0._h:_fn_(*)=n$1 [line 30, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"sHandler:#B#instance.590685250eb38eaab242405cd45c572b_3" -> "sHandler:#B#instance.590685250eb38eaab242405cd45c572b_2" ;
|
|
|
|
}
|