# HG changeset patch # User Frits van Bommel # Date 1236566651 -3600 # Node ID 802d508f66f1ff3bcd5cd41c81f28be7f77395c7 # Parent 7d9957c6350e0a0a611855c9406c1ecaef52b083 Ignore the ABI some more for intrinsics diff -r 7d9957c6350e -r 802d508f66f1 gen/functions.cpp --- a/gen/functions.cpp Sun Mar 08 17:57:34 2009 +0100 +++ b/gen/functions.cpp Mon Mar 09 03:44:11 2009 +0100 @@ -37,8 +37,10 @@ return llvm::cast(type->ir.type->get()); } - // Tell the ABI we're resolving a new function type - gABI->newFunctionType(f); + if (f->linkage != LINKintrinsic) { + // Tell the ABI we're resolving a new function type + gABI->newFunctionType(f); + } // start new ir funcTy f->fty.reset(); @@ -57,17 +59,18 @@ Type* rt = f->next; unsigned a = 0; // sret return - if (gABI->returnInArg(f)) - { - f->fty.arg_sret = new IrFuncTyArg(rt, true, llvm::Attribute::StructRet); - rt = Type::tvoid; - lidx++; - } - // sext/zext return - else if (unsigned se = DtoShouldExtend(rt)) - { - a = se; - } + if (f->linkage != LINKintrinsic) + if (gABI->returnInArg(f)) + { + f->fty.arg_sret = new IrFuncTyArg(rt, true, llvm::Attribute::StructRet); + rt = Type::tvoid; + lidx++; + } + // sext/zext return + else if (unsigned se = DtoShouldExtend(rt)) + { + a = se; + } f->fty.ret = new IrFuncTyArg(rt, false, a); } lidx++; @@ -145,7 +148,8 @@ argtype = ltd; } // byval - else if (gABI->passByVal(argtype)) + else if (f->linkage != LINKintrinsic + && gABI->passByVal(argtype)) { if (!byref) a |= llvm::Attribute::ByVal; byref = true; @@ -160,11 +164,13 @@ lidx++; } - // let the abi rewrite the types as necesary - gABI->rewriteFunctionType(f); + if (f->linkage != LINKintrinsic) { + // let the abi rewrite the types as necesary + gABI->rewriteFunctionType(f); - // Tell the ABI we're done with this function type - gABI->doneWithFunctionType(); + // Tell the ABI we're done with this function type + gABI->doneWithFunctionType(); + } // build the function type std::vector argtypes;