Summary: This diff translates ``` autoreleasepool { body; } ``` into ``` _objc_autoreleasePoolPush(); body; _objc_autoreleasePoolPop(); ``` Reviewed By: ezgicicek Differential Revision: D23478313 fbshipit-source-id: 313edd281master
parent
cf322a4e84
commit
44ff6df1d6
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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/Foundation.h>
|
||||
|
||||
@interface Autoreleasepool : NSObject
|
||||
|
||||
@end
|
||||
|
||||
@implementation Autoreleasepool
|
||||
|
||||
- (void)test {
|
||||
@autoreleasepool {
|
||||
int i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)test1 {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
@autoreleasepool {
|
||||
int i = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)test2 {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
@autoreleasepool {
|
||||
for (int j = 0; j < 10; j++) {
|
||||
int k = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
@ -0,0 +1,146 @@
|
||||
/* @generated */
|
||||
digraph cfg {
|
||||
"dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_1" [label="1: Start Autoreleasepool.dealloc\nFormals: self:Autoreleasepool*\nLocals: \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_1" -> "dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_3" ;
|
||||
"dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_2" [label="2: Exit Autoreleasepool.dealloc \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_3" [label="3: Call dealloc \n " shape="box"]
|
||||
|
||||
|
||||
"dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_3" -> "dealloc#Autoreleasepool#instance.65b3873c13c8c3701384d7b6f48e27f7_2" ;
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_1" [label="1: Start Autoreleasepool.test\nFormals: self:Autoreleasepool*\nLocals: i:int \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_1" -> "test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_3" ;
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_2" [label="2: Exit Autoreleasepool.test \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_3" [label="3: Call _objc_autoreleasePoolPush \n n$0=_fun__objc_autoreleasePoolPush() [line 17, column 3]\n " shape="box"]
|
||||
|
||||
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_3" -> "test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_5" ;
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_4" [label="4: Call _objc_autoreleasePoolPop \n n$1=_fun__objc_autoreleasePoolPop() [line 17, column 3]\n " shape="box"]
|
||||
|
||||
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_4" -> "test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_2" ;
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_5" [label="5: DeclStmt \n VARIABLE_DECLARED(i:int); [line 18, column 5]\n *&i:int=0 [line 18, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_5" -> "test#Autoreleasepool#instance.17592bbc7bbec05b6df3b9d1e8a76b10_4" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_1" [label="1: Start Autoreleasepool.test1\nFormals: self:Autoreleasepool*\nLocals: i:int i:int \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_1" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_4" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_2" [label="2: Exit Autoreleasepool.test1 \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_3" [label="3: + \n " ]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_3" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_6" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_4" [label="4: DeclStmt \n VARIABLE_DECLARED(i:int); [line 23, column 8]\n *&i:int=0 [line 23, column 8]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_4" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_3" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_5" [label="5: UnaryOperator \n n$2=*&i:int [line 23, column 27]\n *&i:int=(n$2 + 1) [line 23, column 27]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_5" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_3" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_6" [label="6: BinaryOperatorStmt: LT \n n$3=*&i:int [line 23, column 19]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_6" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_7" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_6" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_8" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_7" [label="7: Prune (true branch, for loop) \n PRUNE((n$3 < 10), true); [line 23, column 19]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_7" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_9" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_8" [label="8: Prune (false branch, for loop) \n PRUNE(!(n$3 < 10), false); [line 23, column 19]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_8" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_2" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_9" [label="9: Call _objc_autoreleasePoolPush \n n$4=_fun__objc_autoreleasePoolPush() [line 24, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_9" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_11" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_10" [label="10: Call _objc_autoreleasePoolPop \n n$5=_fun__objc_autoreleasePoolPop() [line 24, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_10" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_5" ;
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_11" [label="11: DeclStmt \n VARIABLE_DECLARED(i:int); [line 25, column 7]\n *&i:int=0 [line 25, column 7]\n " shape="box"]
|
||||
|
||||
|
||||
"test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_11" -> "test1#Autoreleasepool#instance.206a0aed2a32589ebf3507c0b44a4caf_10" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_1" [label="1: Start Autoreleasepool.test2\nFormals: self:Autoreleasepool*\nLocals: i:int j:int k:int \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_1" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_4" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_2" [label="2: Exit Autoreleasepool.test2 \n " color=yellow style=filled]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_3" [label="3: + \n " ]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_3" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_6" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_4" [label="4: DeclStmt \n VARIABLE_DECLARED(i:int); [line 31, column 8]\n *&i:int=0 [line 31, column 8]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_4" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_3" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_5" [label="5: UnaryOperator \n n$7=*&i:int [line 31, column 27]\n *&i:int=(n$7 + 1) [line 31, column 27]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_5" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_3" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_6" [label="6: BinaryOperatorStmt: LT \n n$8=*&i:int [line 31, column 19]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_6" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_7" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_6" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_8" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_7" [label="7: Prune (true branch, for loop) \n PRUNE((n$8 < 10), true); [line 31, column 19]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_7" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_9" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_8" [label="8: Prune (false branch, for loop) \n PRUNE(!(n$8 < 10), false); [line 31, column 19]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_8" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_2" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_9" [label="9: Call _objc_autoreleasePoolPush \n n$9=_fun__objc_autoreleasePoolPush() [line 32, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_9" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_12" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_10" [label="10: Call _objc_autoreleasePoolPop \n n$10=_fun__objc_autoreleasePoolPop() [line 32, column 5]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_10" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_5" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_11" [label="11: + \n " ]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_11" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_14" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_12" [label="12: DeclStmt \n VARIABLE_DECLARED(j:int); [line 33, column 12]\n *&j:int=0 [line 33, column 12]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_12" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_11" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_13" [label="13: UnaryOperator \n n$11=*&j:int [line 33, column 31]\n *&j:int=(n$11 + 1) [line 33, column 31]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_13" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_11" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_14" [label="14: BinaryOperatorStmt: LT \n n$12=*&j:int [line 33, column 23]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_14" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_15" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_14" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_16" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_15" [label="15: Prune (true branch, for loop) \n PRUNE((n$12 < 10), true); [line 33, column 23]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_15" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_17" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_16" [label="16: Prune (false branch, for loop) \n PRUNE(!(n$12 < 10), false); [line 33, column 23]\n " shape="invhouse"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_16" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_10" ;
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_17" [label="17: DeclStmt \n VARIABLE_DECLARED(k:int); [line 34, column 9]\n *&k:int=0 [line 34, column 9]\n " shape="box"]
|
||||
|
||||
|
||||
"test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_17" -> "test2#Autoreleasepool#instance.620673c62b0512b60564c16015598db8_13" ;
|
||||
}
|
Loading…
Reference in new issue