comparison 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
comparison
equal deleted inserted replaced
413:1a9bdbd4ac60 414:ac1fcc138e42
89 DValue* DtoBinRem(DValue* lhs, DValue* rhs); 89 DValue* DtoBinRem(DValue* lhs, DValue* rhs);
90 90
91 // target stuff 91 // target stuff
92 void findDefaultTarget(); 92 void findDefaultTarget();
93 93
94 /**
95 * Calls a D function (with D calling conv).
96 * @param fdecl The FuncDeclaration to call
97 * @param arguments The Array of ExpressionS to pass as arguments.
98 * @param type Optionally the TypeClass of the 'this' arguement.
99 * @param thismem Optionally the LLValue for the 'this' argument.
100 * @return The function call's return value.
101 */
102 DValue* DtoCallDFunc(FuncDeclaration* fdecl, Array* arguments, TypeClass* type=0, LLValue* thismem=0);
103
104 /// Converts any value to a boolean (llvm i1) 94 /// Converts any value to a boolean (llvm i1)
105 LLValue* DtoBoolean(Loc& loc, DValue* dval); 95 LLValue* DtoBoolean(Loc& loc, DValue* dval);
106 96
97 ////////////////////////////////////////////
98 // gen/tocall.cpp stuff below
99 ////////////////////////////////////////////
100
101 /// convert DMD calling conv to LLVM
102 unsigned DtoCallingConv(LINK l);
103
104 ///
105 TypeFunction* DtoTypeFunction(Type* type);
106
107 ///
108 DValue* DtoVaArg(Loc& loc, Type* type, Expression* valistArg);
109
110 ///
111 LLValue* DtoCallableValue(DValue* fn);
112
113 ///
114 const LLFunctionType* DtoExtractFunctionType(const LLType* type);
115
116 ///
117 void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::PAListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx);
118
119 ///
120 DValue* DtoCallFunction(Type* resulttype, DValue* fnval, Expressions* arguments);
121
107 #endif 122 #endif