diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-25 16:55:45 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-25 16:55:45 +0000 |
commit | 314cc81b8caacd6f9b3f74c4e32ac9403d8d4052 (patch) | |
tree | 4f031e0740266d6687313f6792788bb5af6352a0 /clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | |
parent | 68855fe3c912c1cf183fe01621ea4f38a2dd7752 (diff) | |
download | bcm5719-llvm-314cc81b8caacd6f9b3f74c4e32ac9403d8d4052.tar.gz bcm5719-llvm-314cc81b8caacd6f9b3f74c4e32ac9403d8d4052.zip |
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
Diffstat (limited to 'clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp')
-rw-r--r-- | clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 759e57e32b5..9b86492051a 100644 --- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -976,7 +976,7 @@ void RewriteModernObjC::RewritePropertyImplDecl(ObjCPropertyImplDecl *PID, // return objc_getProperty(self, _cmd, offsetof(ClassDecl, OID), 1) Getr += "typedef "; const FunctionType *FPRetType = 0; - RewriteTypeIntoString(PD->getGetterMethodDecl()->getResultType(), Getr, + RewriteTypeIntoString(PD->getGetterMethodDecl()->getReturnType(), Getr, FPRetType); Getr += " _TYPE"; if (FPRetType) { @@ -1259,8 +1259,8 @@ void RewriteModernObjC::RewriteTypeIntoString(QualType T, std::string &ResultStr else if (const BlockPointerType *BPT = retType->getAs<BlockPointerType>()) PointeeTy = BPT->getPointeeType(); if ((FPRetType = PointeeTy->getAs<FunctionType>())) { - ResultStr += FPRetType->getResultType().getAsString( - Context->getPrintingPolicy()); + ResultStr += + FPRetType->getReturnType().getAsString(Context->getPrintingPolicy()); ResultStr += "(*"; } } else @@ -1273,7 +1273,7 @@ void RewriteModernObjC::RewriteObjCMethodDecl(const ObjCInterfaceDecl *IDecl, //fprintf(stderr,"In RewriteObjCMethodDecl\n"); const FunctionType *FPRetType = 0; ResultStr += "\nstatic "; - RewriteTypeIntoString(OMD->getResultType(), ResultStr, FPRetType); + RewriteTypeIntoString(OMD->getReturnType(), ResultStr, FPRetType); ResultStr += " "; // Unique method name @@ -2272,7 +2272,7 @@ void RewriteModernObjC::RewriteObjCQualifiedInterfaceTypes(Decl *Dcl) { proto = dyn_cast<FunctionProtoType>(funcType); if (!proto) return; - Type = proto->getResultType(); + Type = proto->getReturnType(); } else if (FieldDecl *FD = dyn_cast<FieldDecl>(Dcl)) { Loc = FD->getLocation(); @@ -2446,7 +2446,7 @@ void RewriteModernObjC::RewriteBlockLiteralFunctionDecl(FunctionDecl *FD) { const FunctionProtoType *proto = dyn_cast<FunctionProtoType>(funcType); if (!proto) return; - QualType Type = proto->getResultType(); + QualType Type = proto->getReturnType(); std::string FdStr = Type.getAsString(Context->getPrintingPolicy()); FdStr += " "; FdStr += FD->getName(); @@ -2765,9 +2765,8 @@ Stmt *RewriteModernObjC::RewriteObjCBoxedExpr(ObjCBoxedExpr *Exp) { ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast); const FunctionType *FT = msgSendType->getAs<FunctionType>(); - CallExpr *CE = new (Context) CallExpr(*Context, PE, MsgExprs, - FT->getResultType(), VK_RValue, - EndLoc); + CallExpr *CE = new (Context) + CallExpr(*Context, PE, MsgExprs, FT->getReturnType(), VK_RValue, EndLoc); ReplaceStmt(Exp, CE); return CE; } @@ -2902,9 +2901,8 @@ Stmt *RewriteModernObjC::RewriteObjCArrayLiteralExpr(ObjCArrayLiteral *Exp) { ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast); const FunctionType *FT = msgSendType->getAs<FunctionType>(); - CallExpr *CE = new (Context) CallExpr(*Context, PE, MsgExprs, - FT->getResultType(), VK_RValue, - EndLoc); + CallExpr *CE = new (Context) + CallExpr(*Context, PE, MsgExprs, FT->getReturnType(), VK_RValue, EndLoc); ReplaceStmt(Exp, CE); return CE; } @@ -3075,9 +3073,8 @@ Stmt *RewriteModernObjC::RewriteObjCDictionaryLiteralExpr(ObjCDictionaryLiteral ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast); const FunctionType *FT = msgSendType->getAs<FunctionType>(); - CallExpr *CE = new (Context) CallExpr(*Context, PE, MsgExprs, - FT->getResultType(), VK_RValue, - EndLoc); + CallExpr *CE = new (Context) + CallExpr(*Context, PE, MsgExprs, FT->getReturnType(), VK_RValue, EndLoc); ReplaceStmt(Exp, CE); return CE; } @@ -3334,7 +3331,7 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp, // May need to use objc_msgSend_stret() as well. FunctionDecl *MsgSendStretFlavor = 0; if (ObjCMethodDecl *mDecl = Exp->getMethodDecl()) { - QualType resultType = mDecl->getResultType(); + QualType resultType = mDecl->getReturnType(); if (resultType->isRecordType()) MsgSendStretFlavor = MsgSendStretFunctionDecl; else if (resultType->isRealFloatingType()) @@ -3680,8 +3677,8 @@ Stmt *RewriteModernObjC::SynthMessageExpr(ObjCMessageExpr *Exp, ParenExpr *PE = new (Context) ParenExpr(StartLoc, EndLoc, cast); const FunctionType *FT = msgSendType->getAs<FunctionType>(); - CallExpr *CE = new (Context) CallExpr(*Context, PE, MsgExprs, - FT->getResultType(), VK_RValue, EndLoc); + CallExpr *CE = new (Context) + CallExpr(*Context, PE, MsgExprs, FT->getReturnType(), VK_RValue, EndLoc); Stmt *ReplacingStmt = CE; if (MsgSendStretFlavor) { // We have the method which returns a struct/union. Must also generate @@ -4226,7 +4223,7 @@ std::string RewriteModernObjC::SynthesizeBlockFunc(BlockExpr *CE, int i, StringRef funcName, std::string Tag) { const FunctionType *AFT = CE->getFunctionType(); - QualType RT = AFT->getResultType(); + QualType RT = AFT->getReturnType(); std::string StructRef = "struct " + Tag; SourceLocation BlockLoc = CE->getExprLoc(); std::string S; @@ -4731,7 +4728,7 @@ QualType RewriteModernObjC::convertFunctionTypeOfBlocks(const FunctionType *FT) // FTP will be null for closures that don't take arguments. // Generate a funky cast. SmallVector<QualType, 8> ArgTypes; - QualType Res = FT->getResultType(); + QualType Res = FT->getReturnType(); bool modified = convertObjCTypeToCStyleType(Res); if (FTP) { |