Mercurial > projects > ldc
comparison gen/classes.cpp @ 209:c4c9b4ac021b trunk
[svn r225] Fixed: delete expressions no longer use llvm's free instruction, which crashes on a GC provided pointer.
author | lindquist |
---|---|
date | Wed, 14 May 2008 01:22:40 +0200 |
parents | 9d44ec83acd1 |
children | 1d6cfdbc97f0 |
comparison
equal
deleted
inserted
replaced
208:086e1aa99557 | 209:c4c9b4ac021b |
---|---|
930 } | 930 } |
931 } | 931 } |
932 | 932 |
933 ////////////////////////////////////////////////////////////////////////////////////////// | 933 ////////////////////////////////////////////////////////////////////////////////////////// |
934 | 934 |
935 void DtoFinalizeClass(llvm::Value* inst) | |
936 { | |
937 // get runtime function | |
938 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_callfinalizer"); | |
939 // build args | |
940 llvm::SmallVector<llvm::Value*,1> arg; | |
941 arg.push_back(DtoBitCast(inst, fn->getFunctionType()->getParamType(0), ".tmp")); | |
942 // call | |
943 llvm::CallInst::Create(fn, arg.begin(), arg.end(), "", gIR->scopebb()); | |
944 } | |
945 | |
946 ////////////////////////////////////////////////////////////////////////////////////////// | |
947 | |
935 DValue* DtoCastClass(DValue* val, Type* _to) | 948 DValue* DtoCastClass(DValue* val, Type* _to) |
936 { | 949 { |
937 Logger::println("DtoCastClass(%s, %s)", val->getType()->toChars(), _to->toChars()); | 950 Logger::println("DtoCastClass(%s, %s)", val->getType()->toChars(), _to->toChars()); |
938 LOG_SCOPE; | 951 LOG_SCOPE; |
939 | 952 |