Summary: Revert incomplete/incorrect translation of `synchronized` in ObjC. The current translation is incomplete because ``` syncrhonized(foo){ return; } ``` should be translated as ``` __set_locked_attribute(foo); __delete_locked_attribute(foo); return; __delete_locked_attribute(foo); ``` but instead we get ``` __set_locked_attribute(foo); return; __delete_locked_attribute(foo); ``` The same applies for `break`/`continue` etc Reviewed By: skcho Differential Revision: D19718882 fbshipit-source-id: fc49ef529master
parent
1a0c73ab99
commit
9648632bd5
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/NSObject.h>
|
||||
|
||||
void foo(int);
|
||||
|
||||
@interface A : NSObject
|
||||
@end
|
||||
|
||||
@implementation A
|
||||
|
||||
- (void)myMethod:(id)anObj
|
||||
|
||||
{
|
||||
@synchronized(anObj)
|
||||
|
||||
{
|
||||
// Everything between the braces is protected by the @synchronized
|
||||
// directive.
|
||||
int x = 0;
|
||||
x++;
|
||||
foo(x);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -1,30 +0,0 @@
|
||||
/* @generated */
|
||||
digraph cfg {
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_1" [label="1: Start A::myMethod:\nFormals: self:A* anObj:objc_object*\nLocals: x:int \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_1" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_7" ;
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_2" [label="2: Exit A::myMethod: \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_3" [label="3: Call _fun___delete_locked_attribute \n n$0=*&anObj:objc_object* [line 19, column 17]\n n$1=_fun___delete_locked_attribute(n$0:objc_object*) [line 19, column 3]\n " shape="box"]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_3" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_2" ;
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_4" [label="4: Call _fun_foo \n n$2=*&x:int [line 26, column 9]\n n$3=_fun_foo(n$2:int) [line 26, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_4" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_3" ;
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_5" [label="5: UnaryOperator \n n$4=*&x:int [line 25, column 5]\n *&x:int=(n$4 + 1) [line 25, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_5" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_4" ;
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_6" [label="6: DeclStmt \n VARIABLE_DECLARED(x:int); [line 24, column 5]\n *&x:int=0 [line 24, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_6" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_5" ;
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_7" [label="7: Call _fun___set_locked_attribute \n n$5=*&anObj:objc_object* [line 19, column 17]\n n$6=_fun___set_locked_attribute(n$5:objc_object*) [line 19, column 3]\n " shape="box"]
|
||||
|
||||
|
||||
"myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_7" -> "myMethod:#A(struct objc_object)#instance.6280971b05d6b617955d8216a04fe405_6" ;
|
||||
}
|
Loading…
Reference in new issue