diff gen/tollvm.cpp @ 210:1d6cfdbc97f0 trunk

[svn r226] Fixed: deleting interface. Removed: unused util function for calling class destructors.
author lindquist
date Wed, 14 May 2008 02:00:23 +0200
parents c4c9b4ac021b
children 7816aafeea3c
line wrap: on
line diff
--- a/gen/tollvm.cpp	Wed May 14 01:22:40 2008 +0200
+++ b/gen/tollvm.cpp	Wed May 14 02:00:23 2008 +0200
@@ -725,6 +725,17 @@
     llvm::CallInst::Create(fn, arg.begin(), arg.end(), "", gIR->scopebb());
 }
 
+void DtoDeleteInterface(llvm::Value* inst)
+{
+    // get runtime function
+    llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_delinterface");
+    // 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());
+}
+
 void DtoDeleteArray(DValue* arr)
 {
     // get runtime function