diff options
author | Anna Zaks <ganna@apple.com> | 2012-09-27 19:45:11 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-09-27 19:45:11 +0000 |
commit | 454477cd07cfbc44fd48c69049d2299382b4da5b (patch) | |
tree | c81d40a89db7d300e1d4e08dd8b785440dde253f /clang/lib | |
parent | 8c0dd36ede967f55a6be98ee15253d6bbda28f3b (diff) | |
download | bcm5719-llvm-454477cd07cfbc44fd48c69049d2299382b4da5b.tar.gz bcm5719-llvm-454477cd07cfbc44fd48c69049d2299382b4da5b.zip |
Make getDefaultSynthIvarName() a member of ObjCPropertyDecl.
llvm-svn: 164789
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 12 |
2 files changed, 12 insertions, 11 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 4d48ad8e4f5..d28a910d0a5 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -16,6 +16,7 @@ #include "clang/AST/Stmt.h" #include "clang/AST/ASTMutationListener.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" using namespace clang; //===----------------------------------------------------------------------===// @@ -93,6 +94,16 @@ ObjCPropertyDecl::findPropertyDecl(const DeclContext *DC, return 0; } +IdentifierInfo * +ObjCPropertyDecl::getDefaultSynthIvarName(ASTContext &Ctx) const { + SmallString<128> ivarName; + { + llvm::raw_svector_ostream os(ivarName); + os << '_' << getIdentifier()->getName(); + } + return &Ctx.Idents.get(ivarName.str()); +} + /// FindPropertyDeclaration - Finds declaration of the property given its name /// in 'PropertyId' and returns it. It returns 0, if not found. ObjCPropertyDecl * diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index f51ec723996..f32376c5161 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1617,16 +1617,6 @@ ObjCPropertyDecl *Sema::PropertyIfSetterOrGetter(NamedDecl *D) { return 0; } -static IdentifierInfo * getDefaultSynthIvarName(ObjCPropertyDecl *Prop, - ASTContext &Ctx) { - SmallString<128> ivarName; - { - llvm::raw_svector_ostream os(ivarName); - os << '_' << Prop->getIdentifier()->getName(); - } - return &Ctx.Idents.get(ivarName.str()); -} - /// \brief Default synthesizes all properties which must be synthesized /// in class's \@implementation. void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl, @@ -1675,7 +1665,7 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl, ActOnPropertyImplDecl(S, SourceLocation(), SourceLocation(), true, /* property = */ Prop->getIdentifier(), - /* ivar = */ getDefaultSynthIvarName(Prop, Context), + /* ivar = */ Prop->getDefaultSynthIvarName(Context), Prop->getLocation())); if (PIDecl) { Diag(Prop->getLocation(), diag::warn_missing_explicit_synthesis); |