aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-03-31 00:06:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-03-31 00:06:29 +0000
commitaf3e72285238369c2ea4ebd40a1c9a87bd3eabb7 (patch)
treed7a00fc22bf624e4f281eaa55a86c39a3b500365 /lib/Sema
parent0e3e3eb3879d5a7aaca4a393706149ddef8544f1 (diff)
fe support for objc2's nonfragile-abi synthesized ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 18e3e4f909..c68eede104 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1765,17 +1765,22 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
// @synthesize
if (!PropertyIvar)
PropertyIvar = PropertyId;
+ QualType PropType = Context.getCanonicalType(property->getType());
// Check that this is a previously declared 'ivar' in 'IDecl' interface
Ivar = IDecl->lookupInstanceVariable(PropertyIvar);
if (!Ivar) {
- if (getLangOptions().ObjCNonFragileABI)
- Diag(PropertyLoc, diag::error_synthesized_ivar_yet_not_supported)
- << PropertyId;
- else
+ if (getLangOptions().ObjCNonFragileABI) {
+ Ivar = ObjCIvarDecl::Create(Context, CurContext, PropertyLoc,
+ PropertyIvar, PropType,
+ ObjCIvarDecl::Private,
+ (Expr *)0);
+ property->setPropertyIvarDecl(Ivar);
+ }
+ else {
Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId;
- return DeclPtrTy();
+ return DeclPtrTy();
+ }
}
- QualType PropType = Context.getCanonicalType(property->getType());
QualType IvarType = Context.getCanonicalType(Ivar->getType());
// Check that type of property and its ivar are type compatible.