diff options
-rw-r--r-- | include/clang/AST/Type.h | 2 | ||||
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/AST/Type.cpp | 5 | ||||
-rw-r--r-- | lib/Analysis/BasicObjCFoundationChecks.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 14 | ||||
-rw-r--r-- | lib/Sema/Sema.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 25 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 22 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 41 | ||||
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 18 |
13 files changed, 83 insertions, 73 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 28f6e8cf93..1b2519459a 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -53,6 +53,7 @@ namespace clang { class TagType; class TypedefType; class FunctionType; + class FunctionTypeProto; class ExtVectorType; class BuiltinType; class ObjCInterfaceType; @@ -342,6 +343,7 @@ public: // the best type we can. const BuiltinType *getAsBuiltinType() const; const FunctionType *getAsFunctionType() const; + const FunctionTypeProto *getAsFunctionTypeProto() const; const PointerLikeType *getAsPointerLikeType() const; // Pointer or Reference. const PointerType *getAsPointerType() const; const ReferenceType *getAsReferenceType() const; diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 53f31028be..0984ca068b 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -569,7 +569,7 @@ void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) { OS << Node->getValue().toString(10, isSigned); // Emit suffixes. Integer literals are always a builtin integer type. - switch (cast<BuiltinType>(Node->getType().getCanonicalType())->getKind()) { + switch (Node->getType()->getAsBuiltinType()->getKind()) { default: assert(0 && "Unexpected type for integer literal!"); case BuiltinType::Int: break; // no suffix. case BuiltinType::UInt: OS << 'U'; break; diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 08f889a4bf..d5bef07ca9 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -171,6 +171,11 @@ const FunctionType *Type::getAsFunctionType() const { return getDesugaredType()->getAsFunctionType(); } +const FunctionTypeProto *Type::getAsFunctionTypeProto() const { + return dyn_cast_or_null<FunctionTypeProto>(getAsFunctionType()); +} + + const PointerLikeType *Type::getAsPointerLikeType() const { // If this is directly a pointer-like type, return it. if (const PointerLikeType *PTy = dyn_cast<PointerLikeType>(this)) diff --git a/lib/Analysis/BasicObjCFoundationChecks.cpp b/lib/Analysis/BasicObjCFoundationChecks.cpp index 7009e38425..678e190ea5 100644 --- a/lib/Analysis/BasicObjCFoundationChecks.cpp +++ b/lib/Analysis/BasicObjCFoundationChecks.cpp @@ -28,7 +28,6 @@ #include "clang/AST/ASTContext.h" #include "llvm/Support/Compiler.h" -#include <vector> #include <sstream> using namespace clang; @@ -496,7 +495,7 @@ bool AuditCFNumberCreate::Audit(ExplodedNode<ValueState>* N,ValueStateManager&){ if (!LV) return false; - QualType T = LV->getDecl()->getType().getCanonicalType(); + QualType T = Ctx.getCanonicalType(LV->getDecl()->getType()); // FIXME: If the pointee isn't an integer type, should we flag a warning? // People can do weird stuff with pointers. diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 9420f95ad1..448f7ec97c 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -404,18 +404,20 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) { if (E->getOpcode() == UnaryOperator::Extension) return EmitLValue(E->getSubExpr()); + QualType ExprTy=CGM.getContext().getCanonicalType(E->getSubExpr()->getType()); switch (E->getOpcode()) { default: assert(0 && "Unknown unary operator lvalue!"); case UnaryOperator::Deref: return LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()), - E->getSubExpr()->getType().getCanonicalType()->getAsPointerType() - ->getPointeeType().getCVRQualifiers()); + ExprTy->getAsPointerType()->getPointeeType() + .getCVRQualifiers()); case UnaryOperator::Real: case UnaryOperator::Imag: LValue LV = EmitLValue(E->getSubExpr()); unsigned Idx = E->getOpcode() == UnaryOperator::Imag; return LValue::MakeAddr(Builder.CreateStructGEP(LV.getAddress(), - Idx, "idx"),E->getSubExpr()->getType().getCVRQualifiers()); + Idx, "idx"), + ExprTy.getCVRQualifiers()); } } @@ -501,9 +503,11 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // size is a VLA. if (!E->getType()->isConstantSizeType()) assert(0 && "VLA idx not implemented"); + QualType ExprTy = CGM.getContext().getCanonicalType(E->getBase()->getType()); + return LValue::MakeAddr(Builder.CreateGEP(Base, Idx, "arrayidx"), - E->getBase()->getType().getCanonicalType()->getAsPointerType() - ->getPointeeType().getCVRQualifiers()); + ExprTy->getAsPointerType()->getPointeeType() + .getCVRQualifiers()); } static diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index e2986a87a5..bf9f7a0bb3 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -110,7 +110,8 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer) /// ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast. /// If there is already an implicit cast, merge into the existing one. void Sema::ImpCastExprToType(Expr *&Expr, QualType Type) { - if (Expr->getType().getCanonicalType() == Type.getCanonicalType()) return; + if (Context.getCanonicalType(Expr->getType()) == + Context.getCanonicalType(Type)) return; if (ImplicitCastExpr *ImpCast = dyn_cast<ImplicitCastExpr>(Expr)) ImpCast->setType(Type); diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 213577053f..5da9cd7ae2 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -247,8 +247,8 @@ Action::ExprResult Sema::SemaBuiltinShuffleVector(CallExpr *TheCall) { return true; } - if (FAType.getCanonicalType().getUnqualifiedType() != - SAType.getCanonicalType().getUnqualifiedType()) { + if (Context.getCanonicalType(FAType).getUnqualifiedType() != + Context.getCanonicalType(SAType).getUnqualifiedType()) { Diag(TheCall->getLocStart(), diag::err_shufflevector_incompatible_vector, SourceRange(TheCall->getArg(0)->getLocStart(), TheCall->getArg(1)->getLocEnd())); diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 610bf61b60..e046ee9a66 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -384,7 +384,8 @@ Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD, bool &Redeclaration) { /// We need to check this explicitly as an incomplete array definition is /// considered a VariableArrayType, so will not match a complete array /// definition that would be otherwise equivalent. -static bool areEquivalentArrayTypes(QualType NewQType, QualType OldQType) { +static bool areEquivalentArrayTypes(QualType NewQType, QualType OldQType, + ASTContext &Context) { const ArrayType *NewAT = NewQType->getAsArrayType(); const ArrayType *OldAT = OldQType->getAsArrayType(); @@ -403,8 +404,8 @@ static bool areEquivalentArrayTypes(QualType NewQType, QualType OldQType) { if (NewAT->isIncompleteArrayType() || OldAT->isIncompleteArrayType()) { if (NewAT->getIndexTypeQualifier() != OldAT->getIndexTypeQualifier()) return false; - NewQType = NewAT->getElementType().getCanonicalType(); - OldQType = OldAT->getElementType().getCanonicalType(); + NewQType = Context.getCanonicalType(NewAT->getElementType()); + OldQType = Context.getCanonicalType(OldAT->getElementType()); } return NewQType == OldQType; @@ -432,7 +433,8 @@ VarDecl *Sema::MergeVarDecl(VarDecl *New, Decl *OldD) { // Verify the types match. QualType OldCType = Context.getCanonicalType(Old->getType()); QualType NewCType = Context.getCanonicalType(New->getType()); - if (OldCType != NewCType && !areEquivalentArrayTypes(NewCType, OldCType)) { + if (OldCType != NewCType && + !areEquivalentArrayTypes(NewCType, OldCType, Context)) { Diag(New->getLocation(), diag::err_redefinition, New->getName()); Diag(Old->getLocation(), diag::err_previous_definition); return New; @@ -1252,7 +1254,8 @@ bool Sema::CheckForConstantInitializer(Expr *Init, QualType DclT) { if (Init->isNullPointerConstant(Context)) return false; if (Init->getType()->isArithmeticType()) { - QualType InitTy = Init->getType().getCanonicalType().getUnqualifiedType(); + QualType InitTy = Context.getCanonicalType(Init->getType()) + .getUnqualifiedType(); if (InitTy == Context.BoolTy) { // Special handling for pointers implicitly cast to bool; // (e.g. "_Bool rr = &rr;"). This is only legal at the top level. diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 9a38f6cf35..e6a7ce654f 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -42,12 +42,11 @@ static const FunctionTypeProto *getFunctionProto(Decl *d) { } static inline bool isNSStringType(QualType T, ASTContext &Ctx) { - if (!T->isPointerType()) + const PointerType *PT = T->getAsPointerType(); + if (!PT) return false; - T = T->getAsPointerType()->getPointeeType().getCanonicalType(); - ObjCInterfaceType* ClsT = dyn_cast<ObjCInterfaceType>(T.getTypePtr()); - + const ObjCInterfaceType *ClsT =PT->getPointeeType()->getAsObjCInterfaceType(); if (!ClsT) return false; @@ -86,10 +85,9 @@ static void HandleExtVectorTypeAttr(Decl *d, const AttributeList &Attr, } // unlike gcc's vector_size attribute, we do not allow vectors to be defined // in conjunction with complex types (pointers, arrays, functions, etc.). - Type *canonType = curType.getCanonicalType().getTypePtr(); - if (!(canonType->isIntegerType() || canonType->isRealFloatingType())) { + if (!curType->isIntegerType() && !curType->isRealFloatingType()) { S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type, - curType.getCanonicalType().getAsString()); + curType.getAsString()); return; } // unlike gcc's vector_size attribute, the size is specified as the @@ -144,10 +142,8 @@ static void HandleVectorSizeAttr(Decl *D, const AttributeList &Attr, Sema &S) { } // navigate to the base type - we need to provide for vector pointers, // vector arrays, and functions returning vectors. - Type *canonType = CurType.getCanonicalType().getTypePtr(); - - if (canonType->isPointerType() || canonType->isArrayType() || - canonType->isFunctionType()) { + if (CurType->isPointerType() || CurType->isArrayType() || + CurType->isFunctionType()) { assert(0 && "HandleVector(): Complex type construction unimplemented"); /* FIXME: rebuild the type from the inside out, vectorizing the inner type. do { @@ -162,9 +158,9 @@ static void HandleVectorSizeAttr(Decl *D, const AttributeList &Attr, Sema &S) { */ } // the base type must be integer or float. - if (!(canonType->isIntegerType() || canonType->isRealFloatingType())) { + if (!CurType->isIntegerType() && !CurType->isRealFloatingType()) { S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type, - CurType.getCanonicalType().getAsString()); + CurType.getAsString()); return; } unsigned typeSize = static_cast<unsigned>(S.Context.getTypeSize(CurType)); @@ -239,7 +235,6 @@ static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) { // GCC ignores the nonnull attribute on K&R style function // prototypes, so we ignore it as well const FunctionTypeProto *proto = getFunctionProto(d); - if (!proto) { S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type, "nonnull", "function"); @@ -275,7 +270,7 @@ static void HandleNonNullAttr(Decl *d, const AttributeList &Attr, Sema &S) { --x; // Is the function argument a pointer type? - if (!proto->getArgType(x).getCanonicalType()->isPointerType()) { + if (!proto->getArgType(x)->isPointerType()) { // FIXME: Should also highlight argument in decl. S.Diag(Attr.getLoc(), diag::err_nonnull_pointers_only, "nonnull", Ex->getSourceRange()); diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 8050557075..b9a061b011 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -36,8 +36,7 @@ namespace { /// diagnose the use of local variables or parameters within the /// default argument expression. class VISIBILITY_HIDDEN CheckDefaultArgumentVisitor - : public StmtVisitor<CheckDefaultArgumentVisitor, bool> - { + : public StmtVisitor<CheckDefaultArgumentVisitor, bool> { Expr *DefaultArg; Sema *S; @@ -52,11 +51,9 @@ namespace { /// VisitExpr - Visit all of the children of this expression. bool CheckDefaultArgumentVisitor::VisitExpr(Expr *Node) { bool IsInvalid = false; - for (Stmt::child_iterator first = Node->child_begin(), - last = Node->child_end(); - first != last; ++first) - IsInvalid |= Visit(*first); - + for (Stmt::child_iterator I = Node->child_begin(), + E = Node->child_end(); I != E; ++I) + IsInvalid |= Visit(*I); return IsInvalid; } @@ -427,13 +424,14 @@ Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, // C++ 9.2p4: A member-declarator can contain a constant-initializer only // if it declares a static member of const integral or const enumeration // type. - if (CXXClassVarDecl *CVD = - dyn_cast<CXXClassVarDecl>(Member)) { // ...static member of... + if (CXXClassVarDecl *CVD = dyn_cast<CXXClassVarDecl>(Member)) { + // ...static member of... CVD->setInit(Init); - QualType MemberTy = CVD->getType().getCanonicalType(); // ...const integral or const enumeration type. - if (MemberTy.isConstQualified() && MemberTy->isIntegralType()) { - if (CheckForConstantInitializer(Init, MemberTy)) // constant-initializer + if (Context.getCanonicalType(CVD->getType()).isConstQualified() && + CVD->getType()->isIntegralType()) { + // constant-initializer + if (CheckForConstantInitializer(Init, CVD->getType())) InvalidDecl = true; } else { diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index d3e2ed3b1d..56e97c0461 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -727,8 +727,8 @@ Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc, /// TODO: Handle protocol list; such as id<p1,p2> in type comparisons bool Sema::MatchTwoMethodDeclarations(const ObjCMethodDecl *Method, const ObjCMethodDecl *PrevMethod) { - if (Method->getResultType().getCanonicalType() != - PrevMethod->getResultType().getCanonicalType()) + if (Context.getCanonicalType(Method->getResultType()) != + Context.getCanonicalType(PrevMethod->getResultType())) return false; for (unsigned i = 0, e = Method->getNumParams(); i != e; ++i) { ParmVarDecl *ParamDecl = Method->getParamDecl(i); diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d69a0dc061..37e4ec715b 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -105,8 +105,10 @@ QualType Sema::UsualArithmeticConversions(Expr *&lhsExpr, Expr *&rhsExpr, } // For conversion purposes, we ignore any qualifiers. // For example, "const float" and "float" are equivalent. - QualType lhs = lhsExpr->getType().getCanonicalType().getUnqualifiedType(); - QualType rhs = rhsExpr->getType().getCanonicalType().getUnqualifiedType(); + QualType lhs = + Context.getCanonicalType(lhsExpr->getType()).getUnqualifiedType(); + QualType rhs = + Context.getCanonicalType(rhsExpr->getType()).getUnqualifiedType(); // If both types are identical, no conversion is needed. if (lhs == rhs) @@ -1318,8 +1320,8 @@ Sema::CheckPointerTypesForAssignment(QualType lhsType, QualType rhsType) { rhptee = rhsType->getAsPointerType()->getPointeeType(); // make sure we operate on the canonical type - lhptee = lhptee.getCanonicalType(); - rhptee = rhptee.getCanonicalType(); + lhptee = Context.getCanonicalType(lhptee); + rhptee = Context.getCanonicalType(rhptee); AssignConvertType ConvTy = Compatible; @@ -1380,8 +1382,8 @@ Sema::AssignConvertType Sema::CheckAssignmentConstraints(QualType lhsType, QualType rhsType) { // Get canonical types. We're not formatting these types, just comparing // them. - lhsType = lhsType.getCanonicalType().getUnqualifiedType(); - rhsType = rhsType.getCanonicalType().getUnqualifiedType(); + lhsType = Context.getCanonicalType(lhsType).getUnqualifiedType(); + rhsType = Context.getCanonicalType(rhsType).getUnqualifiedType(); if (lhsType == rhsType) return Compatible; // Common case: fast path an exact match. @@ -1497,8 +1499,10 @@ inline QualType Sema::CheckVectorOperands(SourceLocation loc, Expr *&lex, Expr *&rex) { // For conversion purposes, we ignore any qualifiers. // For example, "const float" and "float" are equivalent. - QualType lhsType = lex->getType().getCanonicalType().getUnqualifiedType(); - QualType rhsType = rex->getType().getCanonicalType().getUnqualifiedType(); + QualType lhsType = + Context.getCanonicalType(lex->getType()).getUnqualifiedType(); + QualType rhsType = + Context.getCanonicalType(rex->getType()).getUnqualifiedType(); // If the vector types are identical, return. if (lhsType == rhsType) @@ -1744,9 +1748,9 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation loc, // errors (when -pedantic-errors is enabled). if (lType->isPointerType() && rType->isPointerType()) { // C99 6.5.8p2 QualType LCanPointeeTy = - lType->getAsPointerType()->getPointeeType().getCanonicalType(); + Context.getCanonicalType(lType->getAsPointerType()->getPointeeType()); QualType RCanPointeeTy = - rType->getAsPointerType()->getPointeeType().getCanonicalType(); + Context.getCanonicalType(rType->getAsPointerType()->getPointeeType()); if (!LHSIsNull && !RHSIsNull && // C99 6.5.9p2 !LCanPointeeTy->isVoidType() && !RCanPointeeTy->isVoidType() && @@ -2459,11 +2463,12 @@ Sema::ExprResult Sema::ActOnChooseExpr(SourceLocation BuiltinLoc, ExprTy *cond, /// QualTypes that match the QualTypes of the arguments of the FnType. /// The number of arguments has already been validated to match the number of /// arguments in FnType. -static bool ExprsMatchFnType(Expr **Args, const FunctionTypeProto *FnType) { +static bool ExprsMatchFnType(Expr **Args, const FunctionTypeProto *FnType, + ASTContext &Context) { unsigned NumParams = FnType->getNumArgs(); for (unsigned i = 0; i != NumParams; ++i) { - QualType ExprTy = Args[i]->getType().getCanonicalType(); - QualType ParmTy = FnType->getArgType(i).getCanonicalType(); + QualType ExprTy = Context.getCanonicalType(Args[i]->getType()); + QualType ParmTy = Context.getCanonicalType(FnType->getArgType(i)); if (ExprTy.getUnqualifiedType() != ParmTy.getUnqualifiedType()) return false; @@ -2507,11 +2512,9 @@ Sema::ExprResult Sema::ActOnOverloadExpr(ExprTy **args, unsigned NumArgs, // UsualUnaryConversions will convert the function DeclRefExpr into a // pointer to function. Expr *Fn = UsualUnaryConversions(Args[i]); - FunctionTypeProto *FnType = 0; - if (const PointerType *PT = Fn->getType()->getAsPointerType()) { - QualType PointeeType = PT->getPointeeType().getCanonicalType(); - FnType = dyn_cast<FunctionTypeProto>(PointeeType); - } + const FunctionTypeProto *FnType = 0; + if (const PointerType *PT = Fn->getType()->getAsPointerType()) + FnType = PT->getPointeeType()->getAsFunctionTypeProto(); // The Expr type must be FunctionTypeProto, since FunctionTypeProto has no // parameters, and the number of parameters must match the value passed to @@ -2523,7 +2526,7 @@ Sema::ExprResult Sema::ActOnOverloadExpr(ExprTy **args, unsigned NumArgs, // Scan the parameter list for the FunctionType, checking the QualType of // each parameter against the QualTypes of the arguments to the builtin. // If they match, return a new OverloadExpr. - if (ExprsMatchFnType(Args+1, FnType)) { + if (ExprsMatchFnType(Args+1, FnType, Context)) { if (OE) return Diag(Fn->getExprLoc(), diag::err_overload_multiple_match, OE->getFn()->getSourceRange()); diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 97e1579548..9575d4c3b5 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -233,19 +233,20 @@ Sema::ExprResult Sema::ActOnClassMessage( // ArgExprs is optional - if it is present, the number of expressions // is obtained from Sel.getNumArgs(). Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, - SourceLocation lbrac, SourceLocation rbrac, ExprTy **Args, unsigned NumArgs) -{ + SourceLocation lbrac, + SourceLocation rbrac, + ExprTy **Args, unsigned NumArgs) { assert(receiver && "missing receiver expression"); Expr **ArgExprs = reinterpret_cast<Expr **>(Args); Expr *RExpr = static_cast<Expr *>(receiver); QualType returnType; - QualType receiverType = - RExpr->getType().getCanonicalType().getUnqualifiedType(); + QualType ReceiverCType = + Context.getCanonicalType(RExpr->getType()).getUnqualifiedType(); // Handle messages to id. - if (receiverType == Context.getObjCIdType().getCanonicalType()) { + if (ReceiverCType == Context.getCanonicalType(Context.getObjCIdType())) { ObjCMethodDecl *Method = InstanceMethodPool[Sel].Method; if (!Method) Method = FactoryMethodPool[Sel].Method; @@ -264,7 +265,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, } // Handle messages to Class. - if (receiverType == Context.getObjCClassType().getCanonicalType()) { + if (ReceiverCType == Context.getCanonicalType(Context.getObjCClassType())) { ObjCMethodDecl *Method = 0; if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) { // If we have an implementation in scope, check "private" methods. @@ -297,8 +298,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, // We allow sending a message to a qualified ID ("id<foo>"), which is ok as // long as one of the protocols implements the selector (if not, warn). - if (ObjCQualifiedIdType *QIT = - dyn_cast<ObjCQualifiedIdType>(receiverType)) { + if (ObjCQualifiedIdType *QIT = dyn_cast<ObjCQualifiedIdType>(ReceiverCType)) { // Search protocols for (unsigned i = 0; i < QIT->getNumProtocols(); i++) { ObjCProtocolDecl *PDecl = QIT->getProtocols(i); @@ -310,7 +310,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel, std::string("-"), Sel.getName(), RExpr->getSourceRange()); } else if (const ObjCInterfaceType *OCIReceiver = - receiverType->getAsPointerToObjCInterfaceType()) { + ReceiverCType->getAsPointerToObjCInterfaceType()) { // We allow sending a message to a pointer to an interface (an object). ClassDecl = OCIReceiver->getDecl(); |