diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index c3914d34198..ad3bf5105dd 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -2083,12 +2083,12 @@ const FunctionType *ASTContext::adjustFunctionType(const FunctionType *T, QualType Result; if (const FunctionNoProtoType *FNPT = dyn_cast<FunctionNoProtoType>(T)) { - Result = getFunctionNoProtoType(FNPT->getResultType(), Info); + Result = getFunctionNoProtoType(FNPT->getReturnType(), Info); } else { const FunctionProtoType *FPT = cast<FunctionProtoType>(T); FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo(); EPI.ExtInfo = Info; - Result = getFunctionType(FPT->getResultType(), FPT->getParamTypes(), EPI); + Result = getFunctionType(FPT->getReturnType(), FPT->getParamTypes(), EPI); } return cast<FunctionType>(Result.getTypePtr()); @@ -4795,12 +4795,11 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { Expr->getType()->getAs<BlockPointerType>()->getPointeeType(); // Encode result type. if (getLangOpts().EncodeExtendedBlockSig) - getObjCEncodingForMethodParameter(Decl::OBJC_TQ_None, - BlockTy->getAs<FunctionType>()->getResultType(), - S, true /*Extended*/); + getObjCEncodingForMethodParameter( + Decl::OBJC_TQ_None, BlockTy->getAs<FunctionType>()->getReturnType(), S, + true /*Extended*/); else - getObjCEncodingForType(BlockTy->getAs<FunctionType>()->getResultType(), - S); + getObjCEncodingForType(BlockTy->getAs<FunctionType>()->getReturnType(), S); // Compute size of all parameters. // Start with computing size of a pointer in number of bytes. // FIXME: There might(should) be a better way of doing this computation! @@ -4850,7 +4849,7 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { bool ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl, std::string& S) { // Encode result type. - getObjCEncodingForType(Decl->getResultType(), S); + getObjCEncodingForType(Decl->getReturnType(), S); CharUnits ParmOffset; // Compute size of all parameters. for (FunctionDecl::param_const_iterator PI = Decl->param_begin(), @@ -4912,8 +4911,8 @@ bool ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, bool Extended) const { // FIXME: This is not very efficient. // Encode return type. - getObjCEncodingForMethodParameter(Decl->getObjCDeclQualifier(), - Decl->getResultType(), S, Extended); + getObjCEncodingForMethodParameter(Decl->getObjCDeclQualifier(), + Decl->getReturnType(), S, Extended); // Compute size of all parameters. // Start with computing size of a pointer in number of bytes. // FIXME: There might(should) be a better way of doing this computation! @@ -5414,14 +5413,10 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, S += '<'; // Block return type - getObjCEncodingForTypeImpl(FT->getResultType(), S, - ExpandPointedToStructures, ExpandStructures, - FD, - false /* OutermostType */, - EncodingProperty, - false /* StructField */, - EncodeBlockParameters, - EncodeClassNames); + getObjCEncodingForTypeImpl( + FT->getReturnType(), S, ExpandPointedToStructures, ExpandStructures, + FD, false /* OutermostType */, EncodingProperty, + false /* StructField */, EncodeBlockParameters, EncodeClassNames); // Block self S += "@?"; // Block parameters @@ -6893,23 +6888,23 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, // Check return type QualType retType; if (OfBlockPointer) { - QualType RHS = rbase->getResultType(); - QualType LHS = lbase->getResultType(); + QualType RHS = rbase->getReturnType(); + QualType LHS = lbase->getReturnType(); bool UnqualifiedResult = Unqualified; if (!UnqualifiedResult) UnqualifiedResult = (!RHS.hasQualifiers() && LHS.hasQualifiers()); retType = mergeTypes(LHS, RHS, true, UnqualifiedResult, true); } else - retType = mergeTypes(lbase->getResultType(), rbase->getResultType(), false, + retType = mergeTypes(lbase->getReturnType(), rbase->getReturnType(), false, Unqualified); if (retType.isNull()) return QualType(); if (Unqualified) retType = retType.getUnqualifiedType(); - CanQualType LRetType = getCanonicalType(lbase->getResultType()); - CanQualType RRetType = getCanonicalType(rbase->getResultType()); + CanQualType LRetType = getCanonicalType(lbase->getReturnType()); + CanQualType RRetType = getCanonicalType(rbase->getReturnType()); if (Unqualified) { LRetType = LRetType.getUnqualifiedType(); RRetType = RRetType.getUnqualifiedType(); @@ -7365,10 +7360,10 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) { if (RHSCan->isFunctionType()) { if (!LHSCan->isFunctionType()) return QualType(); - QualType OldReturnType = - cast<FunctionType>(RHSCan.getTypePtr())->getResultType(); + QualType OldReturnType = + cast<FunctionType>(RHSCan.getTypePtr())->getReturnType(); QualType NewReturnType = - cast<FunctionType>(LHSCan.getTypePtr())->getResultType(); + cast<FunctionType>(LHSCan.getTypePtr())->getReturnType(); QualType ResReturnType = mergeObjCGCQualifiers(NewReturnType, OldReturnType); if (ResReturnType.isNull()) @@ -8179,8 +8174,7 @@ ASTContext::ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, if (MethodDecl->getObjCDeclQualifier() != MethodImpl->getObjCDeclQualifier()) return false; - if (!hasSameType(MethodDecl->getResultType(), - MethodImpl->getResultType())) + if (!hasSameType(MethodDecl->getReturnType(), MethodImpl->getReturnType())) return false; if (MethodDecl->param_size() != MethodImpl->param_size()) |

