diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-03-21 10:50:08 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-03-21 10:50:08 +0000 |
commit | 1e255aab650a7fa2047fd953cae65b12215280af (patch) | |
tree | 508d4388db78f87d35bf26a0400b4b03bc4c1f13 /lib/AST/Expr.cpp | |
parent | 1033b7c1e32962948b01a25145829f17bc70a8de (diff) | |
download | FreeBSD-src-1e255aab650a7fa2047fd953cae65b12215280af.zip FreeBSD-src-1e255aab650a7fa2047fd953cae65b12215280af.tar.gz |
Update clang to r99115.
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 1b3202d..6a71e92 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -227,7 +227,12 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { llvm::raw_svector_ostream Out(Name); Out << (MD->isInstanceMethod() ? '-' : '+'); Out << '['; - Out << MD->getClassInterface()->getNameAsString(); + + // For incorrect code, there might not be an ObjCInterfaceDecl. Do + // a null check to avoid a crash. + if (const ObjCInterfaceDecl *ID = MD->getClassInterface()) + Out << ID->getNameAsString(); + if (const ObjCCategoryImplDecl *CID = dyn_cast<ObjCCategoryImplDecl>(MD->getDeclContext())) { Out << '('; @@ -1104,11 +1109,11 @@ Expr::isLvalueResult Expr::isLvalueInternal(ASTContext &Ctx) const { if (m->isArrow()) return LV_Valid; Expr *BaseExp = m->getBase(); - if (BaseExp->getStmtClass() == ObjCPropertyRefExprClass) + if (BaseExp->getStmtClass() == ObjCPropertyRefExprClass || + BaseExp->getStmtClass() == ObjCImplicitSetterGetterRefExprClass) return LV_SubObjCPropertySetting; return - (BaseExp->getStmtClass() == ObjCImplicitSetterGetterRefExprClass) ? - LV_SubObjCPropertyGetterSetting : BaseExp->isLvalue(Ctx); + BaseExp->isLvalue(Ctx); } case UnaryOperatorClass: if (cast<UnaryOperator>(this)->getOpcode() == UnaryOperator::Deref) @@ -1324,8 +1329,6 @@ Expr::isModifiableLvalue(ASTContext &Ctx, SourceLocation *Loc) const { return MLV_InvalidExpression; case LV_MemberFunction: return MLV_MemberFunction; case LV_SubObjCPropertySetting: return MLV_SubObjCPropertySetting; - case LV_SubObjCPropertyGetterSetting: - return MLV_SubObjCPropertyGetterSetting; case LV_ClassTemporary: return MLV_ClassTemporary; } |