Replace assertion with errormessage for unsupported calling conventions. like Pascal. See dstress/run/e/extern_10_A.d

This commit is contained in:
Tomas Lindquist Olsen
2009-02-04 00:04:09 +01:00
parent 280be5ef8e
commit bd4f7ec731
4 changed files with 14 additions and 11 deletions

View File

@@ -33,7 +33,7 @@ TypeFunction* DtoTypeFunction(DValue* fnval)
//////////////////////////////////////////////////////////////////////////////////////////
unsigned DtoCallingConv(LINK l)
unsigned DtoCallingConv(Loc loc, LINK l)
{
if (l == LINKc || l == LINKcpp || l == LINKintrinsic)
return llvm::CallingConv::C;
@@ -50,7 +50,10 @@ unsigned DtoCallingConv(LINK l)
else if (l == LINKwindows)
return llvm::CallingConv::X86_StdCall;
else
assert(0 && "Unsupported calling convention");
{
error(loc, "unsupported calling convention");
fatal();
}
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -235,7 +238,7 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
bool nestedcall = tf->usesNest;
bool dvarargs = (tf->linkage == LINKd && tf->varargs == 1);
unsigned callconv = DtoCallingConv(tf->linkage);
unsigned callconv = DtoCallingConv(loc, tf->linkage);
// get callee llvm value
LLValue* callable = DtoCallableValue(fnval);