|
|
|
/* @generated */
|
|
|
|
digraph cfg {
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" [label="1: Start main\nFormals: \nLocals: item:NSString* germanCars:NSArray* s:NSString* \n DECLARE_LOCALS(&return,&item,&germanCars,&s); [line 12, column 1]\n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_1" -> "main.fad58de7366495db4650cfefac2fcd61_12" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_2" [label="2: Exit main \n " color=yellow style=filled]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" [label="3: Return Stmt \n *&return:int=0 [line 30, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_3" -> "main.fad58de7366495db4650cfefac2fcd61_2" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" [label="4: + \n " ]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_4" -> "main.fad58de7366495db4650cfefac2fcd61_5" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" [label="5: BinaryOperatorStmt: NE \n n$0=*&item:NSString* [line 26, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" -> "main.fad58de7366495db4650cfefac2fcd61_6" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_5" -> "main.fad58de7366495db4650cfefac2fcd61_7" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_6" [label="6: Prune (true branch, while) \n PRUNE((n$0 != null), true); [line 26, column 3]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_6" -> "main.fad58de7366495db4650cfefac2fcd61_9" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_7" [label="7: Prune (false branch, while) \n PRUNE(!(n$0 != null), false); [line 26, column 3]\n " shape="invhouse"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_7" -> "main.fad58de7366495db4650cfefac2fcd61_3" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_8" [label="8: BinaryOperatorStmt: Assign \n n$1=*&germanCars:NSArray* [line 26, column 26]\n n$2=_fun_NSArray_nextObject(n$1:NSArray*) virtual [line 26, column 3]\n *&item:NSString*=n$2 [line 26, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_8" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_9" [label="9: Call _fun_NSLog \n n$3=_fun_NSString_stringWithUTF8String:(\"%@\":char* const ) [line 27, column 11]\n n$4=*&item:NSString* [line 27, column 18]\n n$5=_fun_NSLog(n$3:objc_object*,n$4:NSString*) [line 27, column 5]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_9" -> "main.fad58de7366495db4650cfefac2fcd61_8" ;
|
[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
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_10" [label="10: BinaryOperatorStmt: Assign \n n$7=*&germanCars:NSArray* [line 26, column 26]\n n$8=_fun_NSArray_nextObject(n$7:NSArray*) virtual [line 26, column 3]\n *&item:NSString*=n$8 [line 26, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_10" -> "main.fad58de7366495db4650cfefac2fcd61_4" ;
|
[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
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_11" [label="11: BinaryOperatorStmt: Assign \n n$9=*&germanCars:NSArray* [line 24, column 7]\n n$10=_fun_NSArray_objectAtIndexedSubscript:(n$9:NSArray*,3:unsigned long) virtual [line 24, column 7]\n *&s:NSString*=n$10 [line 24, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_11" -> "main.fad58de7366495db4650cfefac2fcd61_10" ;
|
[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
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_12" [label="12: DeclStmt \n n$16=_fun_NSString_stringWithUTF8String:(\"Mercedes-Benz\":char* const ) [line 17, column 5]\n n$11=_fun_NSString_stringWithUTF8String:(\"BMW\":char* const ) [line 18, column 5]\n n$12=_fun_NSString_stringWithUTF8String:(\"Porsche\":char* const ) [line 19, column 5]\n n$13=_fun_NSString_stringWithUTF8String:(\"Opel\":char* const ) [line 20, column 5]\n n$14=_fun_NSString_stringWithUTF8String:(\"Volkswagen\":char* const ) [line 21, column 5]\n n$15=_fun_NSString_stringWithUTF8String:(\"Audi\":char* const ) [line 22, column 5]\n n$17=_fun_NSArray_arrayWithObjects:count:(n$16:objc_object*,n$11:objc_object*,n$12:objc_object*,n$13:objc_object*,n$14:objc_object*,n$15:objc_object*,null:objc_object*) [line 16, column 25]\n *&germanCars:NSArray*=n$17 [line 16, column 3]\n " shape="box"]
|
|
|
|
|
|
|
|
|
|
|
|
"main.fad58de7366495db4650cfefac2fcd61_12" -> "main.fad58de7366495db4650cfefac2fcd61_11" ;
|
|
|
|
}
|