[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Sun Oct 17 22:29:41 PDT 2004



Changes in directory llvm-java/lib/Compiler:

Compiler.cpp updated: 1.121 -> 1.122
---
Log message:

Get vtable correctly in do_new().


---
Diffs of the changes:  (+5 -1)

Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.121 llvm-java/lib/Compiler/Compiler.cpp:1.122
--- llvm-java/lib/Compiler/Compiler.cpp:1.121	Sun Oct 17 23:57:45 2004
+++ llvm-java/lib/Compiler/Compiler.cpp	Mon Oct 18 00:29:30 2004
@@ -1555,7 +1555,11 @@
       Value* objRef = new MallocInst(ci.type,
                                      ConstantUInt::get(Type::UIntTy, 0),
                                      TMP, current_);
-      Value* vtable = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef);
+      Value* objBase = getField(cf, LLVM_JAVA_OBJECT_BASE, objRef);
+      Function* f = module_.getOrInsertFunction(
+        LLVM_JAVA_GETOBJECTCLASS, PointerType::get(VTableInfo::VTableTy),
+        objBase->getType(), NULL);
+      Value* vtable = new CallInst(f, objBase, TMP, current_);
       vtable = new CastInst(vtable, PointerType::get(vi.vtable->getType()),
                             TMP, current_);
       vtable = new StoreInst(vi.vtable, vtable, current_);






More information about the llvm-commits mailing list