Mercurial > projects > ldc
diff gen/llvmhelpers.h @ 414:ac1fcc138e42
Fixed issue with internal real representation, incorrect for non x86-32 architectures.
Cleaned up CallExp::toElem, moved implementation to tocall.cpp providing a single procedure to call arbitrary D functions fairly easily.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 28 Jul 2008 02:11:34 +0200 |
parents | 0e6b4d65d3f8 |
children | 023fa78c1203 |
line wrap: on
line diff
--- a/gen/llvmhelpers.h Sun Jul 27 18:52:40 2008 +0200 +++ b/gen/llvmhelpers.h Mon Jul 28 02:11:34 2008 +0200 @@ -91,17 +91,32 @@ // target stuff void findDefaultTarget(); -/** - * Calls a D function (with D calling conv). - * @param fdecl The FuncDeclaration to call - * @param arguments The Array of ExpressionS to pass as arguments. - * @param type Optionally the TypeClass of the 'this' arguement. - * @param thismem Optionally the LLValue for the 'this' argument. - * @return The function call's return value. - */ -DValue* DtoCallDFunc(FuncDeclaration* fdecl, Array* arguments, TypeClass* type=0, LLValue* thismem=0); - /// Converts any value to a boolean (llvm i1) LLValue* DtoBoolean(Loc& loc, DValue* dval); +//////////////////////////////////////////// +// gen/tocall.cpp stuff below +//////////////////////////////////////////// + +/// convert DMD calling conv to LLVM +unsigned DtoCallingConv(LINK l); + +/// +TypeFunction* DtoTypeFunction(Type* type); + +/// +DValue* DtoVaArg(Loc& loc, Type* type, Expression* valistArg); + +/// +LLValue* DtoCallableValue(DValue* fn); + +/// +const LLFunctionType* DtoExtractFunctionType(const LLType* type); + +/// +void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::PAListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx); + +/// +DValue* DtoCallFunction(Type* resulttype, DValue* fnval, Expressions* arguments); + #endif