[svn r225] Fixed: delete expressions no longer use llvm's free instruction, which crashes on a GC provided pointer.

This commit is contained in:
Tomas Lindquist Olsen
2008-05-14 01:22:40 +02:00
parent bcc112e37f
commit 19748f09ec
12 changed files with 241 additions and 145 deletions

View File

@@ -932,6 +932,19 @@ void DtoCallClassDtors(TypeClass* tc, llvm::Value* instance)
//////////////////////////////////////////////////////////////////////////////////////////
void DtoFinalizeClass(llvm::Value* inst)
{
// get runtime function
llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_callfinalizer");
// build args
llvm::SmallVector<llvm::Value*,1> arg;
arg.push_back(DtoBitCast(inst, fn->getFunctionType()->getParamType(0), ".tmp"));
// call
llvm::CallInst::Create(fn, arg.begin(), arg.end(), "", gIR->scopebb());
}
//////////////////////////////////////////////////////////////////////////////////////////
DValue* DtoCastClass(DValue* val, Type* _to)
{
Logger::println("DtoCastClass(%s, %s)", val->getType()->toChars(), _to->toChars());