diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-19 16:14:33 +0000 | 
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-19 16:14:33 +0000 | 
| commit | 2a36089eef6bf8c1c4937cf6be4ce802a728c369 (patch) | |
| tree | 71a99bb839ddcb13098181b984a9489c2ae25610 /clang/lib/Sema/SemaExpr.cpp | |
| parent | 58c283ee852babe6a3df3e3a13ca5363270b8a2d (diff) | |
| download | bcm5719-llvm-2a36089eef6bf8c1c4937cf6be4ce802a728c369.tar.gz bcm5719-llvm-2a36089eef6bf8c1c4937cf6be4ce802a728c369.zip | |
Categories cannot synthesize property ivars,
and a minor cleanup.
llvm-svn: 108707
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 2d3aaf6edc0..447dc387320 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1006,7 +1006,6 @@ bool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R,  }  static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef, -                                               ASTContext &Context,                                                 IdentifierInfo *II,                                                 SourceLocation NameLoc) {    ObjCMethodDecl *CurMeth = SemaRef.getCurMethodDecl(); @@ -1014,7 +1013,8 @@ static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef,    if (!IDecl)      return 0;    ObjCImplementationDecl *ClassImpDecl = IDecl->getImplementation(); -  assert(ClassImpDecl && "Method not inside @implementation"); +  if (!ClassImpDecl) +    return 0;    bool DynamicImplSeen = false;    ObjCPropertyDecl *property = SemaRef.LookupPropertyDecl(IDecl, II);    if (!property) @@ -1023,8 +1023,8 @@ static ObjCIvarDecl *SynthesizeProvisionalIvar(Sema &SemaRef,      DynamicImplSeen =         (PIDecl->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic);    if (!DynamicImplSeen) { -    QualType PropType = Context.getCanonicalType(property->getType()); -    ObjCIvarDecl *Ivar = ObjCIvarDecl::Create(Context, ClassImpDecl,  +    QualType PropType = SemaRef.Context.getCanonicalType(property->getType()); +    ObjCIvarDecl *Ivar = ObjCIvarDecl::Create(SemaRef.Context, ClassImpDecl,                                                 NameLoc,                                                II, PropType, /*Dinfo=*/0,                                                ObjCIvarDecl::Protected, @@ -1104,7 +1104,7 @@ Sema::OwningExprResult Sema::ActOnIdExpression(Scope *S,        if (Ex) return Owned(Ex);        // Synthesize ivars lazily        if (getLangOptions().ObjCNonFragileABI2) { -        if (SynthesizeProvisionalIvar(*this, Context, II, NameLoc)) +        if (SynthesizeProvisionalIvar(*this, II, NameLoc))            return ActOnIdExpression(S, SS, Id, HasTrailingLParen,                                     isAddressOfOperand);        } | 

