[cfe-commits] r149279 - in /cfe/trunk: lib/CodeGen/CGObjCMac.cpp test/CodeGenObjC/arc.m
John McCall
rjmccall at apple.com
Mon Jan 30 14:08:52 PST 2012
On Jan 30, 2012, at 1:40 PM, Fariborz Jahanian wrote:
> - RValue complete(CodeGenFunction &CGF, RValue result, QualType resultType) {
> + RValue complete(CodeGenFunction &CGF, RValue result, QualType resultType,
> + const CallArgList &CallArgs,
> + const ObjCMethodDecl *Method) {
> if (!NullBB) return result;
> +
> + llvm::Value *NullInitPtr = 0;
> + if (result.isScalar() && !resultType->isVoidType()) {
> + NullInitPtr = CGF.CreateTempAlloca(result.getScalarVal()->getType());
> + CGF.Builder.CreateStore(result.getScalarVal(), NullInitPtr);
> + }
I think you're missing the complex-number case here.
> + if (result.isScalar()) {
> + if (NullInitPtr)
> + CGF.EmitNullInitialization(NullInitPtr, resultType);
> + // Jump to the continuation block.
> + CGF.EmitBlock(contBB);
> + return NullInitPtr ? RValue::get(CGF.Builder.CreateLoad(NullInitPtr))
> + : result;
> + }
And here.
> + bool requiresnullCheck = false;
I'm not sure why this flag is necessary.
> @@ -5785,7 +5833,8 @@
> llvm::PointerType::getUnqual(fnType));
>
> RValue result = CGF.EmitCall(fnInfo, callee, returnSlot, args);
> - return nullReturn.complete(CGF, result, resultType);
> + CallArgList CallArgs;
> + return nullReturn.complete(CGF, result, resultType, CallArgs, 0);
I think you want 'args' here instead of a new, empty CallArgList, and you
should probably add a test for a v-table dispatch that consumes an
argument. @selector(isEqual:) should work.
John.
More information about the cfe-commits
mailing list