blob: 7eb2a9bfc7e7f063fc02fb3cd34be56ca6f31f14 [file] [log] [blame]
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +00001//===--- TransProperties.cpp - Tranformations to ARC mode -----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000010// rewriteProperties:
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000011//
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000012// - Adds strong/weak/unsafe_unretained ownership specifier to properties that
13// are missing one.
14// - Migrates properties from (retain) to (strong) and (assign) to
15// (unsafe_unretained/weak).
16// - If a property is synthesized, adds the ownership specifier in the ivar
17// backing the property.
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000018//
19// @interface Foo : NSObject {
20// NSObject *x;
21// }
22// @property (assign) id x;
23// @end
24// ---->
25// @interface Foo : NSObject {
26// NSObject *__weak x;
27// }
28// @property (weak) id x;
29// @end
30//
31//===----------------------------------------------------------------------===//
32
33#include "Transforms.h"
34#include "Internals.h"
35#include "clang/Sema/SemaDiagnostic.h"
36#include "clang/Basic/SourceManager.h"
37#include "clang/Lex/Lexer.h"
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000038#include <map>
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000039
40using namespace clang;
41using namespace arcmt;
42using namespace trans;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000043
44namespace {
45
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000046class PropertiesRewriter {
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +000047 MigrationContext &MigrateCtx;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000048 MigrationPass &Pass;
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +000049 ObjCImplementationDecl *CurImplD;
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000050
51 enum PropActionKind {
52 PropAction_None,
Fariborz Jahanian86f96012012-01-20 19:15:02 +000053 PropAction_RetainReplacedWithStrong,
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +000054 PropAction_AssignRemoved,
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000055 PropAction_AssignRewritten,
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000056 PropAction_MaybeAddWeakOrUnsafe
57 };
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000058
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000059 struct PropData {
60 ObjCPropertyDecl *PropD;
61 ObjCIvarDecl *IvarD;
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000062 ObjCPropertyImplDecl *ImplD;
63
64 PropData(ObjCPropertyDecl *propD) : PropD(propD), IvarD(0), ImplD(0) { }
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000065 };
66
Chris Lattner5f9e2722011-07-23 10:55:15 +000067 typedef SmallVector<PropData, 2> PropsTy;
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000068 typedef std::map<unsigned, PropsTy> AtPropDeclsTy;
69 AtPropDeclsTy AtProps;
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000070 llvm::DenseMap<IdentifierInfo *, PropActionKind> ActionOnProp;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000071
72public:
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +000073 explicit PropertiesRewriter(MigrationContext &MigrateCtx)
74 : MigrateCtx(MigrateCtx), Pass(MigrateCtx.Pass) { }
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000075
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000076 static void collectProperties(ObjCContainerDecl *D, AtPropDeclsTy &AtProps) {
77 for (ObjCInterfaceDecl::prop_iterator
78 propI = D->prop_begin(),
79 propE = D->prop_end(); propI != propE; ++propI) {
80 if (propI->getAtLoc().isInvalid())
81 continue;
82 PropsTy &props = AtProps[propI->getAtLoc().getRawEncoding()];
83 props.push_back(*propI);
84 }
85 }
86
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000087 void doTransform(ObjCImplementationDecl *D) {
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +000088 CurImplD = D;
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +000089 ObjCInterfaceDecl *iface = D->getClassInterface();
90 if (!iface)
91 return;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000092
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +000093 collectProperties(iface, AtProps);
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +000094
95 typedef DeclContext::specific_decl_iterator<ObjCPropertyImplDecl>
96 prop_impl_iterator;
97 for (prop_impl_iterator
98 I = prop_impl_iterator(D->decls_begin()),
99 E = prop_impl_iterator(D->decls_end()); I != E; ++I) {
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000100 ObjCPropertyImplDecl *implD = *I;
101 if (implD->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
102 continue;
103 ObjCPropertyDecl *propD = implD->getPropertyDecl();
104 if (!propD || propD->isInvalidDecl())
105 continue;
106 ObjCIvarDecl *ivarD = implD->getPropertyIvarDecl();
107 if (!ivarD || ivarD->isInvalidDecl())
108 continue;
109 unsigned rawAtLoc = propD->getAtLoc().getRawEncoding();
110 AtPropDeclsTy::iterator findAtLoc = AtProps.find(rawAtLoc);
111 if (findAtLoc == AtProps.end())
112 continue;
113
114 PropsTy &props = findAtLoc->second;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000115 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
116 if (I->PropD == propD) {
117 I->IvarD = ivarD;
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000118 I->ImplD = implD;
119 break;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000120 }
121 }
122 }
123
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000124 for (AtPropDeclsTy::iterator
125 I = AtProps.begin(), E = AtProps.end(); I != E; ++I) {
126 SourceLocation atLoc = SourceLocation::getFromRawEncoding(I->first);
127 PropsTy &props = I->second;
Argyrios Kyrtzidis1d5fb8f2011-11-06 18:58:07 +0000128 if (!getPropertyType(props)->isObjCRetainableType())
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000129 continue;
Argyrios Kyrtzidisbf8455c2011-11-07 18:40:32 +0000130 if (hasIvarWithExplicitARCOwnership(props))
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000131 continue;
132
133 Transaction Trans(Pass.TA);
134 rewriteProperty(props, atLoc);
135 }
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000136
137 AtPropDeclsTy AtExtProps;
138 // Look through extensions.
139 for (ObjCCategoryDecl *Cat = iface->getCategoryList();
140 Cat; Cat = Cat->getNextClassCategory())
141 if (Cat->IsClassExtension())
142 collectProperties(Cat, AtExtProps);
143
144 for (AtPropDeclsTy::iterator
145 I = AtExtProps.begin(), E = AtExtProps.end(); I != E; ++I) {
146 SourceLocation atLoc = SourceLocation::getFromRawEncoding(I->first);
147 PropsTy &props = I->second;
148 Transaction Trans(Pass.TA);
149 doActionForExtensionProp(props, atLoc);
150 }
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000151 }
152
153private:
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000154 void doPropAction(PropActionKind kind,
155 PropsTy &props, SourceLocation atLoc,
156 bool markAction = true) {
157 if (markAction)
158 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
159 ActionOnProp[I->PropD->getIdentifier()] = kind;
160
161 switch (kind) {
162 case PropAction_None:
163 return;
Fariborz Jahanian86f96012012-01-20 19:15:02 +0000164 case PropAction_RetainReplacedWithStrong: {
165 StringRef toAttr = "strong";
166 MigrateCtx.rewritePropertyAttribute("retain", toAttr, atLoc);
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000167 return;
Fariborz Jahanian86f96012012-01-20 19:15:02 +0000168 }
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000169 case PropAction_AssignRemoved:
170 return removeAssignForDefaultStrong(props, atLoc);
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000171 case PropAction_AssignRewritten:
172 return rewriteAssign(props, atLoc);
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000173 case PropAction_MaybeAddWeakOrUnsafe:
174 return maybeAddWeakOrUnsafeUnretainedAttr(props, atLoc);
175 }
176 }
177
178 void doActionForExtensionProp(PropsTy &props, SourceLocation atLoc) {
179 llvm::DenseMap<IdentifierInfo *, PropActionKind>::iterator I;
180 I = ActionOnProp.find(props[0].PropD->getIdentifier());
181 if (I == ActionOnProp.end())
182 return;
183
184 doPropAction(I->second, props, atLoc, false);
185 }
186
187 void rewriteProperty(PropsTy &props, SourceLocation atLoc) {
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000188 ObjCPropertyDecl::PropertyAttributeKind propAttrs = getPropertyAttrs(props);
189
190 if (propAttrs & (ObjCPropertyDecl::OBJC_PR_copy |
191 ObjCPropertyDecl::OBJC_PR_unsafe_unretained |
192 ObjCPropertyDecl::OBJC_PR_strong |
193 ObjCPropertyDecl::OBJC_PR_weak))
194 return;
195
196 if (propAttrs & ObjCPropertyDecl::OBJC_PR_retain) {
Argyrios Kyrtzidis8b08eb32011-11-08 23:09:34 +0000197 // strong is the default.
Fariborz Jahanian86f96012012-01-20 19:15:02 +0000198 return doPropAction(PropAction_RetainReplacedWithStrong, props, atLoc);
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000199 }
200
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000201 bool HasIvarAssignedAPlusOneObject = hasIvarAssignedAPlusOneObject(props);
202
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000203 if (propAttrs & ObjCPropertyDecl::OBJC_PR_assign) {
Fariborz Jahanian2f72ec92012-01-21 00:43:53 +0000204 if (HasIvarAssignedAPlusOneObject)
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000205 return doPropAction(PropAction_AssignRemoved, props, atLoc);
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000206 return doPropAction(PropAction_AssignRewritten, props, atLoc);
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000207 }
208
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000209 if (HasIvarAssignedAPlusOneObject ||
210 (Pass.isGCMigration() && !hasGCWeak(props, atLoc)))
Argyrios Kyrtzidisaf9b5e92011-11-08 22:10:58 +0000211 return; // 'strong' by default.
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000212
Argyrios Kyrtzidis44679012011-10-18 19:49:19 +0000213 return doPropAction(PropAction_MaybeAddWeakOrUnsafe, props, atLoc);
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000214 }
215
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000216 void removeAssignForDefaultStrong(PropsTy &props,
217 SourceLocation atLoc) const {
218 removeAttribute("retain", atLoc);
219 if (!removeAttribute("assign", atLoc))
220 return;
221
222 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
223 if (I->ImplD)
224 Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
225 I->ImplD->getLocation());
226 }
227 }
228
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000229 void rewriteAssign(PropsTy &props, SourceLocation atLoc) const {
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000230 bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props),
231 /*AllowOnUnknownClass=*/Pass.isGCMigration());
Fariborz Jahanian2f72ec92012-01-21 00:43:53 +0000232 const char *toWhich =
233 (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "strong" :
234 (canUseWeak ? "weak" : "unsafe_unretained");
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000235
Fariborz Jahanian2f72ec92012-01-21 00:43:53 +0000236 bool rewroteAttr = rewriteAttribute("assign", toWhich, atLoc);
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000237 if (!rewroteAttr)
238 canUseWeak = false;
239
240 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
Argyrios Kyrtzidis6d7d16d2011-11-28 00:23:12 +0000241 if (isUserDeclared(I->IvarD)) {
242 if (I->IvarD &&
Fariborz Jahanian2f72ec92012-01-21 00:43:53 +0000243 I->IvarD->getType().getObjCLifetime() != Qualifiers::OCL_Weak) {
244 const char *toWhich =
245 (Pass.isGCMigration() && !hasGCWeak(props, atLoc)) ? "__strong " :
246 (canUseWeak ? "__weak " : "__unsafe_unretained ");
247 Pass.TA.insert(I->IvarD->getLocation(), toWhich);
248 }
Argyrios Kyrtzidis6d7d16d2011-11-28 00:23:12 +0000249 }
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000250 if (I->ImplD)
251 Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
252 I->ImplD->getLocation());
253 }
254 }
255
256 void maybeAddWeakOrUnsafeUnretainedAttr(PropsTy &props,
257 SourceLocation atLoc) const {
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000258 bool canUseWeak = canApplyWeak(Pass.Ctx, getPropertyType(props),
259 /*AllowOnUnknownClass=*/Pass.isGCMigration());
Argyrios Kyrtzidis8b08eb32011-11-08 23:09:34 +0000260
261 bool addedAttr = addAttribute(canUseWeak ? "weak" : "unsafe_unretained",
262 atLoc);
263 if (!addedAttr)
264 canUseWeak = false;
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000265
266 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
Argyrios Kyrtzidis6d7d16d2011-11-28 00:23:12 +0000267 if (isUserDeclared(I->IvarD)) {
268 if (I->IvarD &&
269 I->IvarD->getType().getObjCLifetime() != Qualifiers::OCL_Weak)
270 Pass.TA.insert(I->IvarD->getLocation(),
271 canUseWeak ? "__weak " : "__unsafe_unretained ");
272 }
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000273 if (I->ImplD) {
274 Pass.TA.clearDiagnostic(diag::err_arc_assign_property_ownership,
275 I->ImplD->getLocation());
276 Pass.TA.clearDiagnostic(
277 diag::err_arc_objc_property_default_assign_on_object,
278 I->ImplD->getLocation());
279 }
280 }
281 }
282
Argyrios Kyrtzidis01b2b9b2011-10-17 23:14:16 +0000283 bool removeAttribute(StringRef fromAttr, SourceLocation atLoc) const {
Argyrios Kyrtzidis6da42742011-11-28 02:04:36 +0000284 return MigrateCtx.removePropertyAttribute(fromAttr, atLoc);
Argyrios Kyrtzidis01b2b9b2011-10-17 23:14:16 +0000285 }
286
Chris Lattner5f9e2722011-07-23 10:55:15 +0000287 bool rewriteAttribute(StringRef fromAttr, StringRef toAttr,
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000288 SourceLocation atLoc) const {
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000289 return MigrateCtx.rewritePropertyAttribute(fromAttr, toAttr, atLoc);
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000290 }
291
Chris Lattner5f9e2722011-07-23 10:55:15 +0000292 bool addAttribute(StringRef attr, SourceLocation atLoc) const {
Argyrios Kyrtzidis6da42742011-11-28 02:04:36 +0000293 return MigrateCtx.addPropertyAttribute(attr, atLoc);
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000294 }
295
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000296 class PlusOneAssign : public RecursiveASTVisitor<PlusOneAssign> {
297 ObjCIvarDecl *Ivar;
298 public:
299 PlusOneAssign(ObjCIvarDecl *D) : Ivar(D) {}
300
301 bool VisitBinAssign(BinaryOperator *E) {
302 Expr *lhs = E->getLHS()->IgnoreParenImpCasts();
303 if (ObjCIvarRefExpr *RE = dyn_cast<ObjCIvarRefExpr>(lhs)) {
304 if (RE->getDecl() != Ivar)
305 return true;
306
Argyrios Kyrtzidis94a90162011-08-10 21:46:48 +0000307 if (ObjCMessageExpr *
308 ME = dyn_cast<ObjCMessageExpr>(E->getRHS()->IgnoreParenCasts()))
309 if (ME->getMethodFamily() == OMF_retain)
310 return false;
311
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000312 ImplicitCastExpr *implCE = dyn_cast<ImplicitCastExpr>(E->getRHS());
313 while (implCE && implCE->getCastKind() == CK_BitCast)
314 implCE = dyn_cast<ImplicitCastExpr>(implCE->getSubExpr());
315
John McCall33e56f32011-09-10 06:18:15 +0000316 if (implCE && implCE->getCastKind() == CK_ARCConsumeObject)
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000317 return false;
318 }
319
320 return true;
321 }
322 };
323
324 bool hasIvarAssignedAPlusOneObject(PropsTy &props) const {
325 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
326 PlusOneAssign oneAssign(I->IvarD);
327 bool notFound = oneAssign.TraverseDecl(CurImplD);
328 if (!notFound)
329 return true;
330 }
331
332 return false;
333 }
334
Argyrios Kyrtzidisbf8455c2011-11-07 18:40:32 +0000335 bool hasIvarWithExplicitARCOwnership(PropsTy &props) const {
336 if (Pass.isGCMigration())
337 return false;
338
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000339 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I) {
340 if (isUserDeclared(I->IvarD)) {
341 if (isa<AttributedType>(I->IvarD->getType()))
342 return true;
343 if (I->IvarD->getType().getLocalQualifiers().getObjCLifetime()
344 != Qualifiers::OCL_Strong)
345 return true;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000346 }
347 }
348
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000349 return false;
350 }
351
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000352 bool hasAllIvarsBacked(PropsTy &props) const {
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000353 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
Argyrios Kyrtzidis18fd0c62011-07-27 05:28:18 +0000354 if (!isUserDeclared(I->IvarD))
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000355 return false;
356
357 return true;
358 }
359
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000360 // \brief Returns true if all declarations in the @property have GC __weak.
361 bool hasGCWeak(PropsTy &props, SourceLocation atLoc) const {
362 if (!Pass.isGCMigration())
363 return false;
364 if (props.empty())
365 return false;
366 return MigrateCtx.AtPropsWeak.count(atLoc.getRawEncoding());
367 }
368
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000369 bool isUserDeclared(ObjCIvarDecl *ivarD) const {
370 return ivarD && !ivarD->getSynthesize();
371 }
372
373 QualType getPropertyType(PropsTy &props) const {
374 assert(!props.empty());
Argyrios Kyrtzidis1d5fb8f2011-11-06 18:58:07 +0000375 QualType ty = props[0].PropD->getType().getUnqualifiedType();
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000376
377#ifndef NDEBUG
378 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
Argyrios Kyrtzidis1d5fb8f2011-11-06 18:58:07 +0000379 assert(ty == I->PropD->getType().getUnqualifiedType());
Argyrios Kyrtzidis14c4b442011-07-13 19:22:00 +0000380#endif
381
382 return ty;
383 }
384
385 ObjCPropertyDecl::PropertyAttributeKind
386 getPropertyAttrs(PropsTy &props) const {
387 assert(!props.empty());
388 ObjCPropertyDecl::PropertyAttributeKind
389 attrs = props[0].PropD->getPropertyAttributesAsWritten();
390
391#ifndef NDEBUG
392 for (PropsTy::iterator I = props.begin(), E = props.end(); I != E; ++I)
393 assert(attrs == I->PropD->getPropertyAttributesAsWritten());
394#endif
395
396 return attrs;
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000397 }
398};
399
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000400} // anonymous namespace
401
Argyrios Kyrtzidisb0d5db12011-11-06 18:57:57 +0000402void PropertyRewriteTraverser::traverseObjCImplementation(
403 ObjCImplementationContext &ImplCtx) {
Argyrios Kyrtzidisb0e1e122011-11-07 18:46:46 +0000404 PropertiesRewriter(ImplCtx.getMigrationContext())
Argyrios Kyrtzidisb0d5db12011-11-06 18:57:57 +0000405 .doTransform(ImplCtx.getImplementationDecl());
Argyrios Kyrtzidis7196d062011-06-21 20:20:39 +0000406}