_d_hidden_func needs a parameter.

The DMD implementation is a bit odd. A parameter is passed to the function but the function
itself is declared without a parameter. Then inline assembly is required to retrieve the
parameter.
Just do the same as gdc: declare the passed parameter.
This commit is contained in:
Kai Nacke
2013-11-01 19:01:29 +01:00
parent 81775dfb9a
commit a225ee934d
2 changed files with 4 additions and 3 deletions

View File

@@ -936,10 +936,11 @@ static void LLVM_D_BuildRuntimeModule()
fn->setCallingConv(gABI->callingConv(LINKd));
}
// void _d_hidden_func()
// void _d_hidden_func(Object o)
{
llvm::StringRef fname("_d_hidden_func");
LLFunctionType* fty = llvm::FunctionType::get(voidTy, false);
LLType *types[] = { voidPtrTy };
LLFunctionType* fty = llvm::FunctionType::get(voidTy, types, false);
llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
}