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/CodeGen/CGObjC.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/CodeGen/CGObjC.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index aa990143ac2..9c23ba4b1ee 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -79,10 +79,10 @@ CodeGenFunction::EmitObjCBoxedExpr(const ObjCBoxedExpr *E) { RValue RV = EmitAnyExpr(SubExpr); CallArgList Args; Args.add(RV, ArgQT); - - RValue result = Runtime.GenerateMessageSend(*this, ReturnValueSlot(), - BoxingMethod->getResultType(), Sel, Receiver, Args, - ClassDecl, BoxingMethod); + + RValue result = Runtime.GenerateMessageSend( + *this, ReturnValueSlot(), BoxingMethod->getReturnType(), Sel, Receiver, + Args, ClassDecl, BoxingMethod); return Builder.CreateBitCast(result.getScalarVal(), ConvertType(E->getType())); } @@ -186,12 +186,9 @@ llvm::Value *CodeGenFunction::EmitObjCCollectionLiteral(const Expr *E, llvm::Value *Receiver = Runtime.GetClass(*this, Class); // Generate the message send. - RValue result - = Runtime.GenerateMessageSend(*this, ReturnValueSlot(), - MethodWithObjects->getResultType(), - Sel, - Receiver, Args, Class, - MethodWithObjects); + RValue result = Runtime.GenerateMessageSend( + *this, ReturnValueSlot(), MethodWithObjects->getReturnType(), Sel, + Receiver, Args, Class, MethodWithObjects); // The above message send needs these objects, but in ARC they are // passed in a buffer that is essentially __unsafe_unretained. @@ -238,7 +235,7 @@ static RValue AdjustRelatedResultType(CodeGenFunction &CGF, return Result; if (!Method->hasRelatedResultType() || - CGF.getContext().hasSameType(ExpT, Method->getResultType()) || + CGF.getContext().hasSameType(ExpT, Method->getReturnType()) || !Result.isScalar()) return Result; @@ -369,8 +366,7 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E, shouldExtendReceiverForInnerPointerMessage(E)) Receiver = EmitARCRetainAutorelease(ReceiverType, Receiver); - QualType ResultType = - method ? method->getResultType() : E->getType(); + QualType ResultType = method ? method->getReturnType() : E->getType(); CallArgList Args; EmitCallArgs(Args, method, E->arg_begin(), E->arg_end()); @@ -486,7 +482,7 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD, CurGD = OMD; - StartFunction(OMD, OMD->getResultType(), Fn, FI, args, StartLoc); + StartFunction(OMD, OMD->getReturnType(), Fn, FI, args, StartLoc); // In ARC, certain methods get an extra cleanup. if (CGM.getLangOpts().ObjCAutoRefCount && @@ -904,8 +900,9 @@ CodeGenFunction::generateObjCGetterBody(const ObjCImplementationDecl *classImpl, // We need to fix the type here. Ivars with copy & retain are // always objects so we don't need to worry about complex or // aggregates. - RV = RValue::get(Builder.CreateBitCast(RV.getScalarVal(), - getTypes().ConvertType(getterMethod->getResultType()))); + RV = RValue::get(Builder.CreateBitCast( + RV.getScalarVal(), + getTypes().ConvertType(getterMethod->getReturnType()))); EmitReturnOfRValue(RV, propType); @@ -956,8 +953,8 @@ CodeGenFunction::generateObjCGetterBody(const ObjCImplementationDecl *classImpl, } value = Builder.CreateBitCast(value, ConvertType(propType)); - value = Builder.CreateBitCast(value, - ConvertType(GetterMethodDecl->getResultType())); + value = Builder.CreateBitCast( + value, ConvertType(GetterMethodDecl->getReturnType())); } EmitReturnOfRValue(RValue::get(value), propType); |

