From 314cc81b8caacd6f9b3f74c4e32ac9403d8d4052 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sat, 25 Jan 2014 16:55:45 +0000 Subject: Rename getResultType() on function and method declarations to getReturnType() A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082 --- clang/lib/Sema/SemaStmt.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'clang/lib/Sema/SemaStmt.cpp') diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index e9ae7b90f00..554535dcf22 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -2560,7 +2560,7 @@ Sema::PerformMoveOrCopyInitialization(const InitializedEntity &Entity, static bool hasDeducedReturnType(FunctionDecl *FD) { const FunctionProtoType *FPT = FD->getTypeSourceInfo()->getType()->castAs(); - return FPT->getResultType()->isUndeducedType(); + return FPT->getReturnType()->isUndeducedType(); } /// ActOnCapScopeReturnStmt - Utility routine to type-check return statements @@ -2579,7 +2579,7 @@ Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { // FIXME: Blocks might have a return type of 'auto' explicitly specified. FunctionDecl *FD = CurLambda->CallOperator; if (CurCap->ReturnType.isNull()) - CurCap->ReturnType = FD->getResultType(); + CurCap->ReturnType = FD->getReturnType(); AutoType *AT = CurCap->ReturnType->getContainedAutoType(); assert(AT && "lost auto type from lambda return type"); @@ -2587,7 +2587,7 @@ Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { FD->setInvalidDecl(); return StmtError(); } - CurCap->ReturnType = FnRetType = FD->getResultType(); + CurCap->ReturnType = FnRetType = FD->getReturnType(); } else if (CurCap->HasImplicitReturnType) { // For blocks/lambdas with implicit return types, we check each return // statement individually, and deduce the common return type when the block @@ -2810,14 +2810,14 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { bool isObjCMethod = false; if (const FunctionDecl *FD = getCurFunctionDecl()) { - FnRetType = FD->getResultType(); + FnRetType = FD->getReturnType(); if (FD->hasAttrs()) Attrs = &FD->getAttrs(); if (FD->isNoReturn()) Diag(ReturnLoc, diag::warn_noreturn_function_has_return_expr) << FD->getDeclName(); } else if (ObjCMethodDecl *MD = getCurMethodDecl()) { - FnRetType = MD->getResultType(); + FnRetType = MD->getReturnType(); isObjCMethod = true; if (MD->hasAttrs()) Attrs = &MD->getAttrs(); @@ -2840,7 +2840,7 @@ Sema::ActOnReturnStmt(SourceLocation ReturnLoc, Expr *RetValExp) { FD->setInvalidDecl(); return StmtError(); } else { - FnRetType = FD->getResultType(); + FnRetType = FD->getReturnType(); } } } -- cgit v1.2.3