|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_1" [label="1: Start __infer_globals_initializer_global\nFormals: \nLocals: 0$?%__sil_tmpSIL_temp_conditional___n$0:int \n DECLARE_LOCALS(&return,&0$?%__sil_tmpSIL_temp_conditional___n$0); [line 10, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_1" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_4" ;
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_1" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_5" ;
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_2" [label="2: Exit __infer_globals_initializer_global \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_3" [label="3: + \n " ]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_3" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_8" ;
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_4" [label="4: Prune (true branch, boolean exp) \n PRUNE(1, true); [line 10, column 20]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_4" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_6" ;
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_5" [label="5: Prune (false branch, boolean exp) \n PRUNE(!1, false); [line 10, column 20]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_5" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_7" ;
|
[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
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_6" [label="6: ConditionalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int=2 [line 10, column 20]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_6" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_3" ;
|
[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
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_7" [label="7: ConditionalStmt Branch \n *&0$?%__sil_tmpSIL_temp_conditional___n$0:int=3 [line 10, column 20]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_7" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_3" ;
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_8" [label="8: DeclStmt \n n$1=*&0$?%__sil_tmpSIL_temp_conditional___n$0:int [line 10, column 20]\n *&#GB<codetoanalyze/cpp/frontend/globals/global_const2.cpp>$global:int=n$1 [line 10, column 1]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_8" -> "__infer_globals_initializer_global.bdc08c089842ce08b974b22a75daf78e_2" ;
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_1" [label="1: Start test\nFormals: \nLocals: \n DECLARE_LOCALS(&return); [line 11, 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]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" [label="3: Return Stmt \n n$0=*&#GB<codetoanalyze/cpp/frontend/globals/global_const2.cpp>$global:int [line 11, column 21]\n *&return:int=n$0 [line 11, column 14]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_3" -> "test#18241244337164948030.afc14f193ad97442f67ac7183be789bc_2" ;
|
|
|
|
}
|