From: David Chisnall Date: Sat, 28 May 2011 14:09:01 +0000 (+0000) Subject: Fix missing cast. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bbe0cfd374d0e564c4570b5e84a77f886c32d52;p=clang Fix missing cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132258 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 0b0ffec448..c026eb10e4 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -956,16 +956,17 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF, bool IsClassMessage, const CallArgList &CallArgs, const ObjCMethodDecl *Method) { + CGBuilderTy &Builder = CGF.Builder; if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) { if (Sel == RetainSel || Sel == AutoreleaseSel) { - return RValue::get(Receiver); + return RValue::get(EnforceType(Builder, Receiver, + CGM.getTypes().ConvertType(ResultType))); } if (Sel == ReleaseSel) { return RValue::get(0); } } - CGBuilderTy &Builder = CGF.Builder; llvm::Value *cmd = GetSelector(Builder, Sel); @@ -1063,18 +1064,19 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF, const CallArgList &CallArgs, const ObjCInterfaceDecl *Class, const ObjCMethodDecl *Method) { + CGBuilderTy &Builder = CGF.Builder; + // Strip out message sends to retain / release in GC mode if (CGM.getLangOptions().getGCMode() == LangOptions::GCOnly) { if (Sel == RetainSel || Sel == AutoreleaseSel) { - return RValue::get(Receiver); + return RValue::get(EnforceType(Builder, Receiver, + CGM.getTypes().ConvertType(ResultType))); } if (Sel == ReleaseSel) { return RValue::get(0); } } - CGBuilderTy &Builder = CGF.Builder; - // If the return type is something that goes in an integer register, the // runtime will handle 0 returns. For other cases, we fill in the 0 value // ourselves.