diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index ff54b6b24e4..e4e0052424d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -59,8 +59,8 @@ bool Sema::CanUseDecl(NamedDecl *D) { // If the function has a deduced return type, and we can't deduce it, // then we can't use it either. - if (getLangOpts().CPlusPlus1y && FD->getResultType()->isUndeducedType() && - DeduceReturnType(FD, SourceLocation(), /*Diagnose*/false)) + if (getLangOpts().CPlusPlus1y && FD->getReturnType()->isUndeducedType() && + DeduceReturnType(FD, SourceLocation(), /*Diagnose*/ false)) return false; } @@ -295,7 +295,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, // If the function has a deduced return type, and we can't deduce it, // then we can't use it either. - if (getLangOpts().CPlusPlus1y && FD->getResultType()->isUndeducedType() && + if (getLangOpts().CPlusPlus1y && FD->getReturnType()->isUndeducedType() && DeduceReturnType(FD, Loc)) return true; } @@ -2737,7 +2737,7 @@ ExprResult Sema::BuildDeclarationNameExpr( // If we're referring to a function with an __unknown_anytype // result type, make the entire expression __unknown_anytype. - if (fty->getResultType() == Context.UnknownAnyTy) { + if (fty->getReturnType() == Context.UnknownAnyTy) { type = Context.UnknownAnyTy; valueKind = VK_RValue; break; @@ -2756,7 +2756,7 @@ ExprResult Sema::BuildDeclarationNameExpr( // type. if (!cast<FunctionDecl>(VD)->hasPrototype() && isa<FunctionProtoType>(fty)) - type = Context.getFunctionNoProtoType(fty->getResultType(), + type = Context.getFunctionNoProtoType(fty->getReturnType(), fty->getExtInfo()); // Functions are r-values in C. @@ -2774,7 +2774,7 @@ ExprResult Sema::BuildDeclarationNameExpr( // This should only be possible with a type written directly. if (const FunctionProtoType *proto = dyn_cast<FunctionProtoType>(VD->getType())) - if (proto->getResultType() == Context.UnknownAnyTy) { + if (proto->getReturnType() == Context.UnknownAnyTy) { type = Context.UnknownAnyTy; valueKind = VK_RValue; break; @@ -4220,8 +4220,8 @@ bool Sema::GatherArgumentsForCall(SourceLocation CallLoc, FunctionDecl *FDecl, if (CallType != VariadicDoesNotApply) { // Assume that extern "C" functions with variadic arguments that // return __unknown_anytype aren't *really* variadic. - if (Proto->getResultType() == Context.UnknownAnyTy && - FDecl && FDecl->isExternC()) { + if (Proto->getReturnType() == Context.UnknownAnyTy && FDecl && + FDecl->isExternC()) { for (unsigned i = ArgIx, e = Args.size(); i != e; ++i) { QualType paramType; // ignored ExprResult arg = checkUnknownAnyArg(CallLoc, Args[i], paramType); @@ -4624,7 +4624,7 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, << FDecl->getName() << Fn->getSourceRange()); // CUDA: Kernel function must have 'void' return type - if (!FuncT->getResultType()->isVoidType()) + if (!FuncT->getReturnType()->isVoidType()) return ExprError(Diag(LParenLoc, diag::err_kern_type_not_void_return) << Fn->getType() << Fn->getSourceRange()); } else { @@ -4636,14 +4636,13 @@ Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, } // Check for a valid return type - if (CheckCallReturnType(FuncT->getResultType(), - Fn->getLocStart(), TheCall, + if (CheckCallReturnType(FuncT->getReturnType(), Fn->getLocStart(), TheCall, FDecl)) return ExprError(); // We know the result type of the call, set it. TheCall->setType(FuncT->getCallResultType(Context)); - TheCall->setValueKind(Expr::getValueKindForType(FuncT->getResultType())); + TheCall->setValueKind(Expr::getValueKindForType(FuncT->getReturnType())); const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FuncT); if (Proto) { @@ -7547,8 +7546,8 @@ static bool hasIsEqualMethod(Sema &S, const Expr *LHS, const Expr *RHS) { QualType T = Method->param_begin()[0]->getType(); if (!T->isObjCObjectPointerType()) return false; - - QualType R = Method->getResultType(); + + QualType R = Method->getReturnType(); if (!R->isScalarType()) return false; @@ -10322,7 +10321,7 @@ void Sema::ActOnBlockArguments(SourceLocation CaretLoc, Declarator &ParamInfo, CurBlock->FunctionType = T; const FunctionType *Fn = T->getAs<FunctionType>(); - QualType RetTy = Fn->getResultType(); + QualType RetTy = Fn->getReturnType(); bool isVariadic = (isa<FunctionProtoType>(Fn) && cast<FunctionProtoType>(Fn)->isVariadic()); @@ -10459,7 +10458,7 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, // Otherwise, if we don't need to change anything about the function type, // preserve its sugar structure. - } else if (FTy->getResultType() == RetTy && + } else if (FTy->getReturnType() == RetTy && (!NoReturn || FTy->getNoReturnAttr())) { BlockTy = BSI->FunctionType; @@ -12953,8 +12952,8 @@ ExprResult RebuildUnknownAnyExpr::VisitObjCMessageExpr(ObjCMessageExpr *E) { // Rewrite the method result type if available. if (ObjCMethodDecl *Method = E->getMethodDecl()) { - assert(Method->getResultType() == S.Context.UnknownAnyTy); - Method->setResultType(DestType); + assert(Method->getReturnType() == S.Context.UnknownAnyTy); + Method->setReturnType(DestType); } // Change the type of the message. |

