diff options
| author | Ted Kremenek <kremenek@apple.com> | 2011-09-27 23:39:40 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2011-09-27 23:39:40 +0000 |
| commit | ab2dcc8de6c1973751dd326fe1401e674fe91207 (patch) | |
| tree | 4dacfbebbbf0899fadb0662ac1180eff0606e818 /clang/lib/Sema | |
| parent | 75acd925d0f7c59167cab6dd0bb46458d4c337e4 (diff) | |
| download | bcm5719-llvm-ab2dcc8de6c1973751dd326fe1401e674fe91207.tar.gz bcm5719-llvm-ab2dcc8de6c1973751dd326fe1401e674fe91207.zip | |
Include prefix with default synthesized ivars.
llvm-svn: 140657
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 56aa4480fbe..34c70207659 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1249,10 +1249,20 @@ ObjCPropertyDecl *Sema::LookupPropertyDecl(const ObjCContainerDecl *CDecl, return 0; } +static IdentifierInfo * getDefaultSynthIvarName(ObjCPropertyDecl *Prop, + ASTContext &Ctx) { + llvm::SmallString<128> ivarName; + { + llvm::raw_svector_ostream os(ivarName); + os << '_' << Prop->getIdentifier()->getName(); + } + return &Ctx.Idents.get(ivarName.str()); +} + /// DefaultSynthesizeProperties - This routine default synthesizes all /// properties which must be synthesized in class's @implementation. -void Sema::DefaultSynthesizeProperties (Scope *S, ObjCImplDecl* IMPDecl, - ObjCInterfaceDecl *IDecl) { +void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl, + ObjCInterfaceDecl *IDecl) { llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*> PropMap; CollectClassPropertyImplementations(IDecl, PropMap); @@ -1289,7 +1299,8 @@ void Sema::DefaultSynthesizeProperties (Scope *S, ObjCImplDecl* IMPDecl, // to help users. ActOnPropertyImplDecl(S, SourceLocation(), SourceLocation(), true, - Prop->getIdentifier(), Prop->getIdentifier(), + /* property = */ Prop->getIdentifier(), + /* ivar = */ getDefaultSynthIvarName(Prop, Context), SourceLocation()); } } |

