From 85e2e141db99a0ea0fc67a66f03436a641bcd040 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 29 Mar 2009 05:01:10 +0000 Subject: [PATCH] various cleanups llvm-svn: 67981 --- clang/include/clang/Parse/Action.h | 14 +++++++------- clang/lib/Sema/SemaDeclCXX.cpp | 3 +-- clang/lib/Sema/SemaExprObjC.cpp | 6 ++++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/clang/include/clang/Parse/Action.h b/clang/include/clang/Parse/Action.h index f2f81e18d551..b7bb8d0afd39 100644 --- a/clang/include/clang/Parse/Action.h +++ b/clang/include/clang/Parse/Action.h @@ -1025,7 +1025,7 @@ public: bool Virtual, AccessSpecifier Access, TypeTy *basetype, SourceLocation BaseLoc) { - return 0; + return BaseResult(); } virtual void ActOnBaseSpecifiers(DeclPtrTy ClassDecl, BaseTy **Bases, @@ -1440,7 +1440,7 @@ public: SourceLocation selectorLoc, SourceLocation rbrac, ExprTy **ArgExprs, unsigned NumArgs) { - return 0; + return ExprResult(); } // ActOnInstanceMessage - used for both unary and keyword messages. // ArgExprs is optional - if it is present, the number of expressions @@ -1449,7 +1449,7 @@ public: ExprTy *receiver, Selector Sel, SourceLocation lbrac, SourceLocation selectorLoc, SourceLocation rbrac, ExprTy **ArgExprs, unsigned NumArgs) { - return 0; + return ExprResult(); } virtual DeclPtrTy ActOnForwardClassDeclaration( SourceLocation AtClassLoc, @@ -1479,7 +1479,7 @@ public: virtual ExprResult ParseObjCStringLiteral(SourceLocation *AtLocs, ExprTy **Strings, unsigned NumStrings) { - return 0; + return ExprResult(); } virtual ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc, @@ -1487,7 +1487,7 @@ public: SourceLocation LParenLoc, TypeTy *Ty, SourceLocation RParenLoc) { - return 0; + return ExprResult(); } virtual ExprResult ParseObjCSelectorExpression(Selector Sel, @@ -1495,7 +1495,7 @@ public: SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc) { - return 0; + return ExprResult(); } virtual ExprResult ParseObjCProtocolExpression(IdentifierInfo *ProtocolId, @@ -1503,7 +1503,7 @@ public: SourceLocation ProtoLoc, SourceLocation LParenLoc, SourceLocation RParenLoc) { - return 0; + return ExprResult(); } //===---------------------------- Pragmas -------------------------------===// diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 22e773a7c1d7..2042cd3c8780 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -760,8 +760,7 @@ namespace { for (CXXRecordDecl::base_class_const_iterator Base = RD->bases_begin(), BaseEnd = RD->bases_end(); Base != BaseEnd; ++Base) { if (const RecordType *RT = Base->getType()->getAsRecordType()) { - const CXXRecordDecl *BaseDecl - = cast(RT->getDecl()); + const CXXRecordDecl *BaseDecl = cast(RT->getDecl()); if (BaseDecl && BaseDecl->isAbstract()) Collect(BaseDecl, Methods); } diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index ce9fe8971932..bd94f007bad4 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -410,8 +410,10 @@ Sema::ExprResult Sema::ActOnClassMessage( if (TypedefDecl *OCTD = dyn_cast_or_null(IDecl)) { const ObjCInterfaceType *OCIT; OCIT = OCTD->getUnderlyingType()->getAsObjCInterfaceType(); - if (!OCIT) - return Diag(receiverLoc, diag::err_invalid_receiver_to_message); + if (!OCIT) { + Diag(receiverLoc, diag::err_invalid_receiver_to_message); + return true; + } ClassDecl = OCIT->getDecl(); } }