From a225ee934df52296bf1cba023171ad5efc37d79c Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Fri, 1 Nov 2013 19:01:29 +0100 Subject: [PATCH] _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. --- gen/runtime.cpp | 5 +++-- runtime/druntime | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gen/runtime.cpp b/gen/runtime.cpp index 20de9871..3a9d73c4 100644 --- a/gen/runtime.cpp +++ b/gen/runtime.cpp @@ -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); } diff --git a/runtime/druntime b/runtime/druntime index 9ffca792..4bfde3ea 160000 --- a/runtime/druntime +++ b/runtime/druntime @@ -1 +1 @@ -Subproject commit 9ffca792ac1df0322714f4ba42288e5a18575a55 +Subproject commit 4bfde3ea92fc175d1cc037f72335e71563e5bef7