[cfe-commits] r100958 - in /cfe/trunk/lib/Sema: Sema.h SemaExpr.cpp SemaExprObjC.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 11 00:51:10 PDT 2010
Author: lattner
Date: Sun Apr 11 02:51:10 2010
New Revision: 100958
URL: http://llvm.org/viewvc/llvm-project?rev=100958&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprObjC.cpp
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=100958&r1=100957&r2=100958&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sun Apr 11 02:51:10 2010
@@ -3847,10 +3847,9 @@
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,
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=100958&r1=100957&r2=100958&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sun Apr 11 02:51:10 2010
@@ -3143,9 +3143,7 @@
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 &&
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=100958&r1=100957&r2=100958&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Sun Apr 11 02:51:10 2010
@@ -294,11 +294,8 @@
/// 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 @@
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();
-
}
More information about the cfe-commits
mailing list