diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index a83c72f2b84c..6add2c25c7c9 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -215,7 +215,6 @@ static const llvm::Type* getTypeForFormat(const llvm::fltSemantics &format) { const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { const clang::Type &Ty = *Context.getCanonicalType(T); - //T->dump(); switch (Ty.getTypeClass()) { #define TYPE(Class, Base) #define ABSTRACT_TYPE(Class, Base) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 9c3ef2f6da25..baa2a2b9abb0 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -528,7 +528,6 @@ void Sema::MergeTypeDefDecl(TypedefDecl *New, Decl *OldD) { // Install the built-in type for 'id', ignoring the current definition. New->setTypeForDecl(Context.getObjCIdType().getTypePtr()); return; - break; case 5: if (!TypeID->isStr("Class")) break; diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 058bda4d10a8..d2f3f352c12e 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2226,7 +2226,7 @@ Sema::ActOnMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc, } // Handle properties on ObjC 'Class' types. - if (OpKind == tok::period && (BaseType->isObjCClassType())) { + if (OpKind == tok::period && BaseType->isObjCClassType()) { // Also must look for a getter name which uses property syntax. Selector Sel = PP.getSelectorTable().getNullarySelector(&Member); if (ObjCMethodDecl *MD = getCurMethodDecl()) { @@ -3917,12 +3917,7 @@ QualType Sema::CheckSubtractionOperands(Expr *&lex, Expr *&rex, // Either ptr - int or ptr - ptr. if (lex->getType()->isPointerType() || lex->getType()->isObjCObjectPointerType()) { - QualType lpointee; - if (const PointerType *LHSPTy = lex->getType()->getAsPointerType()) - lpointee = LHSPTy->getPointeeType(); - else if (const ObjCObjectPointerType *OPT = - lex->getType()->getAsObjCObjectPointerType()) - lpointee = OPT->getPointeeType(); + QualType lpointee = lex->getType()->getPointeeType(); // The LHS must be an completely-defined object type. @@ -4295,15 +4290,11 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc, << lType << rType << lex->getSourceRange() << rex->getSourceRange(); } if (lType->isObjCQualifiedIdType() && rType->isObjCQualifiedIdType()) { - if (ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) { - ImpCastExprToType(rex, lType); - return ResultTy; - } else { + if (!ObjCQualifiedIdTypesAreCompatible(lType, rType, true)) Diag(Loc, diag::warn_incompatible_qualified_id_operands) << lType << rType << lex->getSourceRange() << rex->getSourceRange(); - ImpCastExprToType(rex, lType); - return ResultTy; - } + ImpCastExprToType(rex, lType); + return ResultTy; } ImpCastExprToType(rex, lType); return ResultTy; diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index cca4ce355153..1131a9f0d846 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -765,7 +765,6 @@ bool Sema::ObjCQualifiedIdTypesAreCompatible(QualType lhs, QualType rhs, if (!ClassImplementsProtocol(*I, rhsID, true)) return false; } - return true; } // If there are no qualifiers and no interface, we have an 'id'. return true;