summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 0da57330eeb..044216381cf 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1343,22 +1343,9 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
}
}
if (LangOpts.ObjCNonFragileABI2 && LookForIvars && Lookup.empty()) {
- // Find property name matching variable name.
- ObjCPropertyDecl *Prop = LookupPropertyDecl(IFace, II);
- if (Prop && !Prop->isInvalidDecl()) {
- DeclContext *EnclosingContext = cast_or_null<DeclContext>(IFace);
- QualType PropType = Context.getCanonicalType(Prop->getType());
- assert(EnclosingContext &&
- "null DeclContext for synthesized ivar - LookupInObjCMethod");
- ObjCIvarDecl *Ivar = ObjCIvarDecl::Create(Context, EnclosingContext,
- Prop->getLocation(),
- II, PropType, /*Dinfo=*/0,
- ObjCIvarDecl::Public,
- (Expr *)0);
- Ivar->setLexicalDeclContext(IFace);
- IFace->addDecl(Ivar);
+ ObjCIvarDecl *Ivar = SynthesizeNewPropertyIvar(IFace, II);
+ if (Ivar)
return LookupInObjCMethod(Lookup, S, II, AllowBuiltinCreation);
- }
}
// Sentinel value saying that we didn't do anything special.
return Owned((Expr*) 0);
OpenPOWER on IntegriCloud