diff gen/classes.cpp @ 268:23d0d9855cad trunk

[svn r289] Fixed: right shift >> was broken for unsigned types. Fixed: debug info for classes now started.
author lindquist
date Sun, 15 Jun 2008 18:52:27 +0200
parents a95056b3c996
children 1e6e2b5d5bfe
line wrap: on
line diff
--- a/gen/classes.cpp	Sun Jun 15 18:37:23 2008 +0200
+++ b/gen/classes.cpp	Sun Jun 15 18:52:27 2008 +0200
@@ -1327,6 +1327,7 @@
 
 static LLConstant* build_class_dtor(ClassDeclaration* cd)
 {
+#if 0
     // construct the function
     std::vector<const LLType*> paramTypes;
     paramTypes.push_back(getPtrToType(cd->type->ir.type->get()));
@@ -1364,6 +1365,17 @@
     builder.CreateRetVoid();
 
     return llvm::ConstantExpr::getBitCast(func, getPtrToType(LLType::Int8Ty));
+#else
+
+    FuncDeclaration* dtor = cd->dtor;
+
+    // if no destructor emit a null
+    if (!dtor)
+        return getNullPtr(getVoidPtrType());
+
+    DtoForceDeclareDsymbol(dtor);
+    return llvm::ConstantExpr::getBitCast(dtor->ir.irFunc->func, getPtrToType(LLType::Int8Ty));
+#endif
 }
 
 static uint build_classinfo_flags(ClassDeclaration* cd)