[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Wed Sep 15 17:09:46 PDT 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.102 -> 1.103
---
Log message:
Fix invokeinterface codegen.
---
Diffs of the changes: (+6 -6)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.102 llvm-java/lib/Compiler/Compiler.cpp:1.103
--- llvm-java/lib/Compiler/Compiler.cpp:1.102 Wed Sep 15 14:31:21 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Wed Sep 15 19:09:36 2004
@@ -1353,7 +1353,8 @@
}
void do_invokeinterface(unsigned bcI, unsigned index) {
- ConstantMethodRef* methodRef = cf_->getConstantMethodRef(index);
+ ConstantInterfaceMethodRef* methodRef =
+ cf_->getConstantInterfaceMethodRef(index);
ConstantNameAndType* nameAndType = methodRef->getNameAndType();
ClassFile* cf = ClassFile::get(methodRef->getClass()->getName()->str());
@@ -1386,15 +1387,14 @@
new GetElementPtrInst(vtable, indices, TMP, BB);
interfaceVTables = new LoadInst(interfaceVTables, TMP, BB);
// get the actual interface vtable
- indices.resize(1);
+ indices.clear();
indices.push_back(ConstantUInt::get(Type::UIntTy, ci.interfaceIdx));
Value* interfaceVTable =
- new GetElementPtrInst(vtable, indices, TMP, BB);
- interfaceVTable =
- new CastInst(vtable, PointerType::get(VTableInfo::VTableTy),
- TMP, BB);
+ new GetElementPtrInst(interfaceVTables, indices, TMP, BB);
interfaceVTable =
new LoadInst(interfaceVTable, className + "<vtable>", BB);
+ interfaceVTable =
+ new CastInst(interfaceVTable, vi.vtable->getType(), TMP, BB);
// get the function pointer
indices.resize(1);
assert(vi.m2iMap.find(methodDescr) != vi.m2iMap.end() &&
More information about the llvm-commits
mailing list