actually the interface grossness in the previous patch was due to

typo correction.  However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to 
LookupMemberExpr!  Remove grossness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100958 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-04-11 07:51:10 +00:00
Родитель 7f81652f97
Коммит b9d4fc1f54
3 изменённых файлов: 10 добавлений и 17 удалений

Просмотреть файл

@ -3847,10 +3847,9 @@ public:
Action::OwningExprResult
HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
Expr *&BaseExpr, bool &IsArrow,
Expr *BaseExpr,
DeclarationName MemberName,
SourceLocation MemberLoc, SourceLocation OpLoc,
CXXScopeSpec &SS, DeclPtrTy ObjCImpDecl);
SourceLocation MemberLoc);
virtual OwningExprResult ActOnClassPropertyRefExpr(
IdentifierInfo &receiverName,

Просмотреть файл

@ -3143,9 +3143,7 @@ Sema::LookupMemberExpr(LookupResult &R, Expr *&BaseExpr,
if (!IsArrow)
if (const ObjCObjectPointerType *OPT =
BaseType->getAsObjCInterfacePointerType())
return HandleExprPropertyRefExpr(OPT, BaseExpr, IsArrow,
MemberName, MemberLoc,
OpLoc, SS, ObjCImpDecl);
return HandleExprPropertyRefExpr(OPT, BaseExpr, MemberName, MemberLoc);
// Handle the following exceptional case (*Obj).isa.
if (!IsArrow &&

Просмотреть файл

@ -294,11 +294,8 @@ ObjCMethodDecl *Sema::LookupPrivateInstanceMethod(Selector Sel,
/// objective C interface. This is a property reference expression.
Action::OwningExprResult Sema::
HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
Expr *&BaseExpr, bool &IsArrow,
DeclarationName MemberName,
SourceLocation MemberLoc, SourceLocation OpLoc,
CXXScopeSpec &SS, DeclPtrTy ObjCImpDecl) {
assert(!IsArrow && "Should only be called with '.' expressions");
Expr *BaseExpr, DeclarationName MemberName,
SourceLocation MemberLoc) {
const ObjCInterfaceType *IFaceT = OPT->getInterfaceType();
ObjCInterfaceDecl *IFace = IFaceT->getDecl();
IdentifierInfo *Member = MemberName.getAsIdentifierInfo();
@ -377,23 +374,22 @@ HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT,
LookupResult Res(*this, MemberName, MemberLoc, LookupOrdinaryName);
if (CorrectTypo(Res, 0, 0, IFace, false, OPT) &&
Res.getAsSingle<ObjCPropertyDecl>()) {
DeclarationName TypoResult = Res.getLookupName();
Diag(MemberLoc, diag::err_property_not_found_suggest)
<< MemberName << QualType(OPT, 0) << Res.getLookupName()
<< FixItHint::CreateReplacement(MemberLoc,
Res.getLookupName().getAsString());
<< MemberName << QualType(OPT, 0) << TypoResult
<< FixItHint::CreateReplacement(MemberLoc, TypoResult.getAsString());
ObjCPropertyDecl *Property = Res.getAsSingle<ObjCPropertyDecl>();
Diag(Property->getLocation(), diag::note_previous_decl)
<< Property->getDeclName();
return LookupMemberExpr(Res, BaseExpr, IsArrow, OpLoc, SS, ObjCImpDecl);
return HandleExprPropertyRefExpr(OPT, BaseExpr, TypoResult, MemberLoc);
}
Diag(MemberLoc, diag::err_property_not_found)
<< MemberName << QualType(OPT, 0);
if (Setter && !Getter)
Diag(Setter->getLocation(), diag::note_getter_unavailable)
<< MemberName << BaseExpr->getSourceRange();
return ExprError();
}