[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Fri Aug 6 07:45:18 PDT 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.80 -> 1.81
---
Log message:
Fix problem with stores through pointers to superclasses.
---
Diffs of the changes: (+7 -5)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.80 llvm-java/lib/Compiler/Compiler.cpp:1.81
--- llvm-java/lib/Compiler/Compiler.cpp:1.80 Fri Aug 6 06:25:39 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Fri Aug 6 09:45:07 2004
@@ -580,13 +580,15 @@
}
void do_store(unsigned bcI, JType type, unsigned index) {
- Value* v1 = opStack_.top(); opStack_.pop();
- opStack_.push(
- new StoreInst(v1, getOrCreateLocal(index, getType(type)),
- getBBAt(bcI)));
+ Value* val = opStack_.top(); opStack_.pop();
+ const Type* valTy = val->getType();
+ Value* ptr = getOrCreateLocal(index, getType(type));
+ if (!valTy->isPrimitiveType() &&
+ valTy != cast<PointerType>(ptr->getType())->getElementType())
+ ptr = new CastInst(ptr, PointerType::get(valTy), TMP, getBBAt(bcI));
+ opStack_.push(new StoreInst(val, ptr, getBBAt(bcI)));
}
-
void do_astore(unsigned bcI, JType type) {
assert(0 && "not implemented");
}
More information about the llvm-commits
mailing list