[PATCH] D113433: [NFC][clang] Inclusive language: Rename myMaster in testcase
Quinn Pham via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 8 13:14:00 PST 2021
quinnp created this revision.
quinnp requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
[NFC] As part of using inclusive language within the llvm project, this patch
replaces `_myMaster` with `_myLeader` in these testcases.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113433
Files:
clang/test/Rewriter/line-generation-test.m
clang/test/SemaObjC/warn-direct-ivar-access.m
Index: clang/test/SemaObjC/warn-direct-ivar-access.m
===================================================================
--- clang/test/SemaObjC/warn-direct-ivar-access.m
+++ clang/test/SemaObjC/warn-direct-ivar-access.m
@@ -3,39 +3,39 @@
__attribute__((objc_root_class)) @interface MyObject {
@public
- id _myMaster;
+ id _myLeader;
id _isTickledPink; // expected-error {{existing instance variable '_isTickledPink' for property 'isTickledPink'}}
int _myIntProp;
}
- at property(retain) id myMaster;
+ at property(retain) id myLeader;
@property(assign) id isTickledPink; // expected-note {{property declared here}}
@property int myIntProp;
@end
@implementation MyObject
- at synthesize myMaster = _myMaster;
+ at synthesize myLeader = _myLeader;
@synthesize isTickledPink = _isTickledPink; // expected-note {{property synthesized here}}
@synthesize myIntProp = _myIntProp;
- (void) doSomething {
- _myMaster = _isTickledPink; // expected-warning {{instance variable '_myMaster' is being directly accessed}} \
+ _myLeader = _isTickledPink; // expected-warning {{instance variable '_myLeader' is being directly accessed}} \
// expected-warning {{instance variable '_isTickledPink' is being directly accessed}}
}
- (id) init {
- _myMaster=0;
- return _myMaster;
+ _myLeader=0;
+ return _myLeader;
}
-- (void) dealloc { _myMaster = 0; }
+- (void) dealloc { _myLeader = 0; }
@end
MyObject * foo ()
{
MyObject* p=0;
- p.isTickledPink = p.myMaster; // ok
- p->_isTickledPink = (*p)._myMaster; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}} \
- // expected-warning {{instance variable '_myMaster' is being directly accessed}}
+ p.isTickledPink = p.myLeader; // ok
+ p->_isTickledPink = (*p)._myLeader; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}} \
+ // expected-warning {{instance variable '_myLeader' is being directly accessed}}
if (p->_myIntProp) // expected-warning {{instance variable '_myIntProp' is being directly accessed}}
p->_myIntProp = 0; // expected-warning {{instance variable '_myIntProp' is being directly accessed}}
return p->_isTickledPink; // expected-warning {{instance variable '_isTickledPink' is being directly accessed}}
Index: clang/test/Rewriter/line-generation-test.m
===================================================================
--- clang/test/Rewriter/line-generation-test.m
+++ clang/test/Rewriter/line-generation-test.m
@@ -7,20 +7,20 @@
__attribute__((objc_root_class)) @interface MyObject {
@public
- id _myMaster;
+ id _myLeader;
id _isTickledPink;
}
- at property(retain) id myMaster;
+ at property(retain) id myLeader;
@property(assign) id isTickledPink;
@end
@implementation MyObject
- at synthesize myMaster = _myMaster;
+ at synthesize myLeader = _myLeader;
@synthesize isTickledPink = _isTickledPink;
- (void) doSomething {
- _myMaster = _isTickledPink;
+ _myLeader = _isTickledPink;
}
@end
@@ -28,8 +28,8 @@
MyObject * foo ()
{
MyObject* p;
- p.isTickledPink = p.myMaster; // ok
- p->_isTickledPink = p->_myMaster;
+ p.isTickledPink = p.myLeader; // ok
+ p->_isTickledPink = p->_myLeader;
return p->_isTickledPink;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113433.385613.patch
Type: text/x-patch
Size: 3293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211108/1f2293f4/attachment.bin>
More information about the cfe-commits
mailing list