[frontend] Reset id generator before generating ObjC getter/setter

Summary:
This diff resets the id generator before generating ObjC getter/setter, so parsed results are the
same without regard to the generation order.  Note that the order may change when we change the type
of Procname.t since their hash values are used for the hash set of procnames.

Reviewed By: ngorogiannis

Differential Revision: D26277348

fbshipit-source-id: a66d77845
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent b52189d68f
commit b50ff19291

@ -46,6 +46,7 @@ let process_getter_setter proc_name proc_desc =
let location = Procdesc.get_loc proc_desc in
let formals = Procdesc.get_formals proc_desc in
let attributes = Procdesc.get_attributes proc_desc in
Ident.NameGenerator.reset () ;
let getter_setter_instrs =
match (attributes.ProcAttributes.objc_accessor, formals) with
| Some (Objc_getter field), [(self, self_typ)] ->

@ -18,7 +18,7 @@ digraph cfg {
"isOpaque#ASDisplayNode#instance.efbf8192c0bb59de353a9d71765d463c_2" [label="2: Exit ASDisplayNode.isOpaque \n " color=yellow style=filled]
"isOpaque#ASDisplayNode#instance.efbf8192c0bb59de353a9d71765d463c_3" [label="3: BinaryOperatorStmt: Node \n n$2=*&self:ASDisplayNode* [line 12, column 41]\n n$3=*n$2._opaque:_Bool [line 12, column 41]\n *&return:_Bool=n$3 [line 12, column 41]\n " shape="box"]
"isOpaque#ASDisplayNode#instance.efbf8192c0bb59de353a9d71765d463c_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:ASDisplayNode* [line 12, column 41]\n n$1=*n$0._opaque:_Bool [line 12, column 41]\n *&return:_Bool=n$1 [line 12, column 41]\n " shape="box"]
"isOpaque#ASDisplayNode#instance.efbf8192c0bb59de353a9d71765d463c_3" -> "isOpaque#ASDisplayNode#instance.efbf8192c0bb59de353a9d71765d463c_2" ;

@ -44,7 +44,7 @@ digraph cfg {
"x#A#instance.37ea1b3cd5342ae67c7383da2227f91f_2" [label="2: Exit A.x \n " color=yellow style=filled]
"x#A#instance.37ea1b3cd5342ae67c7383da2227f91f_3" [label="3: BinaryOperatorStmt: Node \n n$2=*&self:A* [line 11, column 15]\n n$3=*n$2._x:int [line 11, column 15]\n *&return:int=n$3 [line 11, column 15]\n " shape="box"]
"x#A#instance.37ea1b3cd5342ae67c7383da2227f91f_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:A* [line 11, column 15]\n n$1=*n$0._x:int [line 11, column 15]\n *&return:int=n$1 [line 11, column 15]\n " shape="box"]
"x#A#instance.37ea1b3cd5342ae67c7383da2227f91f_3" -> "x#A#instance.37ea1b3cd5342ae67c7383da2227f91f_2" ;

@ -29,7 +29,7 @@ digraph cfg {
"setNumberOfFiles:#MyProtocol#instance.c62f9b68d4d1ea33789366903af4810a_2" [label="2: Exit MyProtocol.setNumberOfFiles: \n " color=yellow style=filled]
"setNumberOfFiles:#MyProtocol#instance.c62f9b68d4d1ea33789366903af4810a_3" [label="3: BinaryOperatorStmt: Node \n n$2=*&self:MyProtocol* [line 12, column 15]\n n$3=*&numberOfFiles:int [line 12, column 15]\n *n$2.numberOfFiles:int=n$3 [line 12, column 15]\n " shape="box"]
"setNumberOfFiles:#MyProtocol#instance.c62f9b68d4d1ea33789366903af4810a_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:MyProtocol* [line 12, column 15]\n n$1=*&numberOfFiles:int [line 12, column 15]\n *n$0.numberOfFiles:int=n$1 [line 12, column 15]\n " shape="box"]
"setNumberOfFiles:#MyProtocol#instance.c62f9b68d4d1ea33789366903af4810a_3" -> "setNumberOfFiles:#MyProtocol#instance.c62f9b68d4d1ea33789366903af4810a_2" ;

@ -7,7 +7,7 @@ digraph cfg {
"child#NonnullAnnot#instance.90b13dcde8e3b2b21533f2a1e45f4dc4_2" [label="2: Exit NonnullAnnot.child \n " color=yellow style=filled]
"child#NonnullAnnot#instance.90b13dcde8e3b2b21533f2a1e45f4dc4_3" [label="3: BinaryOperatorStmt: Node \n n$3=*&self:NonnullAnnot* [line 11, column 25]\n n$4=*n$3._child:NonnullAnnot* [line 11, column 25]\n *&return:NonnullAnnot*=n$4 [line 11, column 25]\n " shape="box"]
"child#NonnullAnnot#instance.90b13dcde8e3b2b21533f2a1e45f4dc4_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:NonnullAnnot* [line 11, column 25]\n n$1=*n$0._child:NonnullAnnot* [line 11, column 25]\n *&return:NonnullAnnot*=n$1 [line 11, column 25]\n " shape="box"]
"child#NonnullAnnot#instance.90b13dcde8e3b2b21533f2a1e45f4dc4_3" -> "child#NonnullAnnot#instance.90b13dcde8e3b2b21533f2a1e45f4dc4_2" ;
@ -44,7 +44,7 @@ digraph cfg {
"setChild:#NonnullAnnot(class NonnullAnnot)#instance.a6a145a3c260c479880c89d93b389160_2" [label="2: Exit NonnullAnnot.setChild: \n " color=yellow style=filled]
"setChild:#NonnullAnnot(class NonnullAnnot)#instance.a6a145a3c260c479880c89d93b389160_3" [label="3: BinaryOperatorStmt: Node \n n$5=*&self:NonnullAnnot* [line 11, column 25]\n n$6=*&child:NonnullAnnot* [line 11, column 25]\n *n$5._child:NonnullAnnot*=n$6 [line 11, column 25]\n " shape="box"]
"setChild:#NonnullAnnot(class NonnullAnnot)#instance.a6a145a3c260c479880c89d93b389160_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:NonnullAnnot* [line 11, column 25]\n n$1=*&child:NonnullAnnot* [line 11, column 25]\n *n$0._child:NonnullAnnot*=n$1 [line 11, column 25]\n " shape="box"]
"setChild:#NonnullAnnot(class NonnullAnnot)#instance.a6a145a3c260c479880c89d93b389160_3" -> "setChild:#NonnullAnnot(class NonnullAnnot)#instance.a6a145a3c260c479880c89d93b389160_2" ;

@ -56,7 +56,7 @@ digraph cfg {
"name#User#instance.64d2642dd9cada63b69256c9a7def3b2_2" [label="2: Exit User.name \n " color=yellow style=filled]
"name#User#instance.64d2642dd9cada63b69256c9a7def3b2_3" [label="3: BinaryOperatorStmt: Node \n n$5=*&self:User* [line 23, column 40]\n n$6=*n$5._name:NSString* [line 23, column 40]\n *&return:NSString*=n$6 [line 23, column 40]\n " shape="box"]
"name#User#instance.64d2642dd9cada63b69256c9a7def3b2_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:User* [line 23, column 40]\n n$1=*n$0._name:NSString* [line 23, column 40]\n *&return:NSString*=n$1 [line 23, column 40]\n " shape="box"]
"name#User#instance.64d2642dd9cada63b69256c9a7def3b2_3" -> "name#User#instance.64d2642dd9cada63b69256c9a7def3b2_2" ;
@ -86,7 +86,7 @@ digraph cfg {
"setName:#User(class NSString)#instance.feaa984173830aa4a9d325a5924f264f_2" [label="2: Exit User.setName: \n " color=yellow style=filled]
"setName:#User(class NSString)#instance.feaa984173830aa4a9d325a5924f264f_3" [label="3: BinaryOperatorStmt: Node \n n$3=*&self:User* [line 23, column 40]\n n$4=*&name:NSString* [line 23, column 40]\n *n$3._name:NSString*=n$4 [line 23, column 40]\n " shape="box"]
"setName:#User(class NSString)#instance.feaa984173830aa4a9d325a5924f264f_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:User* [line 23, column 40]\n n$1=*&name:NSString* [line 23, column 40]\n *n$0._name:NSString*=n$1 [line 23, column 40]\n " shape="box"]
"setName:#User(class NSString)#instance.feaa984173830aa4a9d325a5924f264f_3" -> "setName:#User(class NSString)#instance.feaa984173830aa4a9d325a5924f264f_2" ;

@ -270,7 +270,7 @@ digraph cfg {
"setX:#DispatchA#instance.b6cea284a46ba947192a21fbc276649b_2" [label="2: Exit DispatchA.setX: \n " color=yellow style=filled]
"setX:#DispatchA#instance.b6cea284a46ba947192a21fbc276649b_3" [label="3: BinaryOperatorStmt: Node \n n$2=*&self:DispatchA* [line 12, column 26]\n n$3=*&x:int [line 12, column 26]\n *n$2._x:int=n$3 [line 12, column 26]\n " shape="box"]
"setX:#DispatchA#instance.b6cea284a46ba947192a21fbc276649b_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:DispatchA* [line 12, column 26]\n n$1=*&x:int [line 12, column 26]\n *n$0._x:int=n$1 [line 12, column 26]\n " shape="box"]
"setX:#DispatchA#instance.b6cea284a46ba947192a21fbc276649b_3" -> "setX:#DispatchA#instance.b6cea284a46ba947192a21fbc276649b_2" ;

@ -56,7 +56,7 @@ digraph cfg {
"setSon:#ArcA(class ArcA)#instance.baae73471012ee089a7558f57ddd56fe_2" [label="2: Exit ArcA.setSon: \n " color=yellow style=filled]
"setSon:#ArcA(class ArcA)#instance.baae73471012ee089a7558f57ddd56fe_3" [label="3: BinaryOperatorStmt: Node \n n$5=*&self:ArcA* [line 14, column 17]\n n$6=*&son:ArcA* [line 14, column 17]\n *n$5._son:ArcA*=n$6 [line 14, column 17]\n " shape="box"]
"setSon:#ArcA(class ArcA)#instance.baae73471012ee089a7558f57ddd56fe_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:ArcA* [line 14, column 17]\n n$1=*&son:ArcA* [line 14, column 17]\n *n$0._son:ArcA*=n$1 [line 14, column 17]\n " shape="box"]
"setSon:#ArcA(class ArcA)#instance.baae73471012ee089a7558f57ddd56fe_3" -> "setSon:#ArcA(class ArcA)#instance.baae73471012ee089a7558f57ddd56fe_2" ;
@ -67,7 +67,7 @@ digraph cfg {
"son#ArcA#instance.eb40da6c5ac3fdfdee0ebe6b666b1ea5_2" [label="2: Exit ArcA.son \n " color=yellow style=filled]
"son#ArcA#instance.eb40da6c5ac3fdfdee0ebe6b666b1ea5_3" [label="3: BinaryOperatorStmt: Node \n n$3=*&self:ArcA* [line 14, column 17]\n n$4=*n$3._son:ArcA* [line 14, column 17]\n *&return:ArcA*=n$4 [line 14, column 17]\n " shape="box"]
"son#ArcA#instance.eb40da6c5ac3fdfdee0ebe6b666b1ea5_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:ArcA* [line 14, column 17]\n n$1=*n$0._son:ArcA* [line 14, column 17]\n *&return:ArcA*=n$1 [line 14, column 17]\n " shape="box"]
"son#ArcA#instance.eb40da6c5ac3fdfdee0ebe6b666b1ea5_3" -> "son#ArcA#instance.eb40da6c5ac3fdfdee0ebe6b666b1ea5_2" ;

@ -169,7 +169,7 @@ digraph cfg {
"setSon:#Auto(class Auto)#instance.b314785cc6e34d48670dac2910ec765e_2" [label="2: Exit Auto.setSon: \n " color=yellow style=filled]
"setSon:#Auto(class Auto)#instance.b314785cc6e34d48670dac2910ec765e_3" [label="3: BinaryOperatorStmt: Node \n n$5=*&self:Auto* [line 15, column 17]\n n$6=*&son:Auto* [line 15, column 17]\n *n$5._son:Auto*=n$6 [line 15, column 17]\n " shape="box"]
"setSon:#Auto(class Auto)#instance.b314785cc6e34d48670dac2910ec765e_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:Auto* [line 15, column 17]\n n$1=*&son:Auto* [line 15, column 17]\n *n$0._son:Auto*=n$1 [line 15, column 17]\n " shape="box"]
"setSon:#Auto(class Auto)#instance.b314785cc6e34d48670dac2910ec765e_3" -> "setSon:#Auto(class Auto)#instance.b314785cc6e34d48670dac2910ec765e_2" ;
@ -180,7 +180,7 @@ digraph cfg {
"son#Auto#instance.10d5e200f659259b61aeb33f58f3b9ab_2" [label="2: Exit Auto.son \n " color=yellow style=filled]
"son#Auto#instance.10d5e200f659259b61aeb33f58f3b9ab_3" [label="3: BinaryOperatorStmt: Node \n n$3=*&self:Auto* [line 15, column 17]\n n$4=*n$3._son:Auto* [line 15, column 17]\n *&return:Auto*=n$4 [line 15, column 17]\n " shape="box"]
"son#Auto#instance.10d5e200f659259b61aeb33f58f3b9ab_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:Auto* [line 15, column 17]\n n$1=*n$0._son:Auto* [line 15, column 17]\n *&return:Auto*=n$1 [line 15, column 17]\n " shape="box"]
"son#Auto#instance.10d5e200f659259b61aeb33f58f3b9ab_3" -> "son#Auto#instance.10d5e200f659259b61aeb33f58f3b9ab_2" ;

@ -78,7 +78,7 @@ digraph cfg {
"name#NonnullC#instance.9c59c8694c0f7942ace24d4346f9a7cd_2" [label="2: Exit NonnullC.name \n " color=yellow style=filled]
"name#NonnullC#instance.9c59c8694c0f7942ace24d4346f9a7cd_3" [label="3: BinaryOperatorStmt: Node \n n$3=*&self:NonnullC* [line 30, column 36]\n n$4=*n$3._name:NSString* [line 30, column 36]\n *&return:NSString*=n$4 [line 30, column 36]\n " shape="box"]
"name#NonnullC#instance.9c59c8694c0f7942ace24d4346f9a7cd_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:NonnullC* [line 30, column 36]\n n$1=*n$0._name:NSString* [line 30, column 36]\n *&return:NSString*=n$1 [line 30, column 36]\n " shape="box"]
"name#NonnullC#instance.9c59c8694c0f7942ace24d4346f9a7cd_3" -> "name#NonnullC#instance.9c59c8694c0f7942ace24d4346f9a7cd_2" ;
@ -89,7 +89,7 @@ digraph cfg {
"setName:#NonnullC(class NSString)#instance.06c11492d4403b7a142558aeec6ac42a_2" [label="2: Exit NonnullC.setName: \n " color=yellow style=filled]
"setName:#NonnullC(class NSString)#instance.06c11492d4403b7a142558aeec6ac42a_3" [label="3: BinaryOperatorStmt: Node \n n$5=*&self:NonnullC* [line 30, column 36]\n n$6=*&name:NSString* [line 30, column 36]\n *n$5._name:NSString*=n$6 [line 30, column 36]\n " shape="box"]
"setName:#NonnullC(class NSString)#instance.06c11492d4403b7a142558aeec6ac42a_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:NonnullC* [line 30, column 36]\n n$1=*&name:NSString* [line 30, column 36]\n *n$0._name:NSString*=n$1 [line 30, column 36]\n " shape="box"]
"setName:#NonnullC(class NSString)#instance.06c11492d4403b7a142558aeec6ac42a_3" -> "setName:#NonnullC(class NSString)#instance.06c11492d4403b7a142558aeec6ac42a_2" ;

@ -30,7 +30,7 @@ digraph cfg {
"child#PropertyA#instance.6f8ba5a5a49be48cc5dabe234a5b1918_2" [label="2: Exit PropertyA.child \n " color=yellow style=filled]
"child#PropertyA#instance.6f8ba5a5a49be48cc5dabe234a5b1918_3" [label="3: BinaryOperatorStmt: Node \n n$19=*&self:PropertyA* [line 12, column 39]\n n$20=*n$19._child:PropertyA* [line 12, column 39]\n *&return:PropertyA*=n$20 [line 12, column 39]\n " shape="box"]
"child#PropertyA#instance.6f8ba5a5a49be48cc5dabe234a5b1918_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 12, column 39]\n n$1=*n$0._child:PropertyA* [line 12, column 39]\n *&return:PropertyA*=n$1 [line 12, column 39]\n " shape="box"]
"child#PropertyA#instance.6f8ba5a5a49be48cc5dabe234a5b1918_3" -> "child#PropertyA#instance.6f8ba5a5a49be48cc5dabe234a5b1918_2" ;
@ -111,7 +111,7 @@ digraph cfg {
"last_name#PropertyA#instance.1ce5ad70e2d4c718c3a98ccc959a3bc9_2" [label="2: Exit PropertyA.last_name \n " color=yellow style=filled]
"last_name#PropertyA#instance.1ce5ad70e2d4c718c3a98ccc959a3bc9_3" [label="3: BinaryOperatorStmt: Node \n n$13=*&self:PropertyA* [line 16, column 52]\n n$14=*n$13._last_name:PropertyA* [line 16, column 52]\n *&return:PropertyA*=n$14 [line 16, column 52]\n " shape="box"]
"last_name#PropertyA#instance.1ce5ad70e2d4c718c3a98ccc959a3bc9_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 16, column 52]\n n$1=*n$0._last_name:PropertyA* [line 16, column 52]\n *&return:PropertyA*=n$1 [line 16, column 52]\n " shape="box"]
"last_name#PropertyA#instance.1ce5ad70e2d4c718c3a98ccc959a3bc9_3" -> "last_name#PropertyA#instance.1ce5ad70e2d4c718c3a98ccc959a3bc9_2" ;
@ -122,7 +122,7 @@ digraph cfg {
"name#PropertyA#instance.c1cdbf324fa14cda26c4633e95fc7667_2" [label="2: Exit PropertyA.name \n " color=yellow style=filled]
"name#PropertyA#instance.c1cdbf324fa14cda26c4633e95fc7667_3" [label="3: BinaryOperatorStmt: Node \n n$17=*&self:PropertyA* [line 14, column 41]\n n$18=*n$17._name:PropertyA* [line 14, column 41]\n *&return:PropertyA*=n$18 [line 14, column 41]\n " shape="box"]
"name#PropertyA#instance.c1cdbf324fa14cda26c4633e95fc7667_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 14, column 41]\n n$1=*n$0._name:PropertyA* [line 14, column 41]\n *&return:PropertyA*=n$1 [line 14, column 41]\n " shape="box"]
"name#PropertyA#instance.c1cdbf324fa14cda26c4633e95fc7667_3" -> "name#PropertyA#instance.c1cdbf324fa14cda26c4633e95fc7667_2" ;
@ -133,7 +133,7 @@ digraph cfg {
"setChild:#PropertyA(class PropertyA)#instance.2830b91fc93649a2fb3b313489bf5461_2" [label="2: Exit PropertyA.setChild: \n " color=yellow style=filled]
"setChild:#PropertyA(class PropertyA)#instance.2830b91fc93649a2fb3b313489bf5461_3" [label="3: BinaryOperatorStmt: Node \n n$11=*&self:PropertyA* [line 12, column 39]\n n$12=*&child:PropertyA* [line 12, column 39]\n *n$11._child:PropertyA*=n$12 [line 12, column 39]\n " shape="box"]
"setChild:#PropertyA(class PropertyA)#instance.2830b91fc93649a2fb3b313489bf5461_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 12, column 39]\n n$1=*&child:PropertyA* [line 12, column 39]\n *n$0._child:PropertyA*=n$1 [line 12, column 39]\n " shape="box"]
"setChild:#PropertyA(class PropertyA)#instance.2830b91fc93649a2fb3b313489bf5461_3" -> "setChild:#PropertyA(class PropertyA)#instance.2830b91fc93649a2fb3b313489bf5461_2" ;
@ -144,7 +144,7 @@ digraph cfg {
"setLast_name:#PropertyA(class PropertyA)#instance.47d6f73ea37f95beeca8ce7a0352c15f_2" [label="2: Exit PropertyA.setLast_name: \n " color=yellow style=filled]
"setLast_name:#PropertyA(class PropertyA)#instance.47d6f73ea37f95beeca8ce7a0352c15f_3" [label="3: BinaryOperatorStmt: Node \n n$15=*&self:PropertyA* [line 16, column 52]\n n$16=*&last_name:PropertyA* [line 16, column 52]\n *n$15._last_name:PropertyA*=n$16 [line 16, column 52]\n " shape="box"]
"setLast_name:#PropertyA(class PropertyA)#instance.47d6f73ea37f95beeca8ce7a0352c15f_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 16, column 52]\n n$1=*&last_name:PropertyA* [line 16, column 52]\n *n$0._last_name:PropertyA*=n$1 [line 16, column 52]\n " shape="box"]
"setLast_name:#PropertyA(class PropertyA)#instance.47d6f73ea37f95beeca8ce7a0352c15f_3" -> "setLast_name:#PropertyA(class PropertyA)#instance.47d6f73ea37f95beeca8ce7a0352c15f_2" ;
@ -155,7 +155,7 @@ digraph cfg {
"setName:#PropertyA(class PropertyA)#instance.530a6c9eaa83786feeaf3a50fc2cd0e6_2" [label="2: Exit PropertyA.setName: \n " color=yellow style=filled]
"setName:#PropertyA(class PropertyA)#instance.530a6c9eaa83786feeaf3a50fc2cd0e6_3" [label="3: BinaryOperatorStmt: Node \n n$9=*&self:PropertyA* [line 14, column 41]\n n$10=*&name:PropertyA* [line 14, column 41]\n *n$9._name:PropertyA*=n$10 [line 14, column 41]\n " shape="box"]
"setName:#PropertyA(class PropertyA)#instance.530a6c9eaa83786feeaf3a50fc2cd0e6_3" [label="3: BinaryOperatorStmt: Node \n n$0=*&self:PropertyA* [line 14, column 41]\n n$1=*&name:PropertyA* [line 14, column 41]\n *n$0._name:PropertyA*=n$1 [line 14, column 41]\n " shape="box"]
"setName:#PropertyA(class PropertyA)#instance.530a6c9eaa83786feeaf3a50fc2cd0e6_3" -> "setName:#PropertyA(class PropertyA)#instance.530a6c9eaa83786feeaf3a50fc2cd0e6_2" ;

Loading…
Cancel
Save