diff gen/toir.c @ 9:dafae18f9c08 trunk

[svn r13] * Updated for LLVM 2.1 * Class v-tables are now typesafe * Code cleanups
author lindquist
date Mon, 01 Oct 2007 21:19:53 +0200
parents 5e69b77a5c51
children d3ee9efe20e2
line wrap: on
line diff
--- a/gen/toir.c	Thu Sep 27 06:03:06 2007 +0200
+++ b/gen/toir.c	Mon Oct 01 21:19:53 2007 +0200
@@ -1246,16 +1246,14 @@
             assert(fdecl->vtblIndex > 0);
             assert(e1->type->ty == Tclass);
 
-            const llvm::Type* vtbltype = llvm::PointerType::get(llvm::ArrayType::get(llvm::PointerType::get(llvm::Type::Int8Ty),0));
-
             llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0, false);
             llvm::Value* vtblidx = llvm::ConstantInt::get(llvm::Type::Int32Ty, (size_t)fdecl->vtblIndex, false);
             funcval = LLVM_DtoGEP(e->arg, zero, zero, "tmp", p->scopebb());
             funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb());
-            funcval = new llvm::BitCastInst(funcval, vtbltype, "tmp", p->scopebb());
             funcval = LLVM_DtoGEP(funcval, zero, vtblidx, "tmp", p->scopebb());
             funcval = new llvm::LoadInst(funcval,"tmp",p->scopebb());
-            funcval = new llvm::BitCastInst(funcval, fdecl->llvmValue->getType(), "tmp", p->scopebb());
+            assert(funcval->getType() == fdecl->llvmValue->getType());
+            //funcval = new llvm::BitCastInst(funcval, fdecl->llvmValue->getType(), "tmp", p->scopebb());
         }
         e->val = funcval;
         e->type = elem::VAL;