[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sat Mar 19 05:50:23 PST 2005
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.235 -> 1.236
---
Log message:
Parametrize getArrayObjectBaseBtr and getArrayLengthPtr with a code
insertion point parameter.
---
Diffs of the changes: (+8 -6)
Compiler.cpp | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.235 llvm-java/lib/Compiler/Compiler.cpp:1.236
--- llvm-java/lib/Compiler/Compiler.cpp:1.235 Sat Mar 19 07:22:32 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Sat Mar 19 07:50:12 2005
@@ -2241,22 +2241,24 @@
push(allocateObject(ci, vi, currentBB_));
}
- Value* getArrayLengthPtr(Value* arrayRef) const {
+ template <typename InsertionPointTy>
+ Value* getArrayLengthPtr(Value* arrayRef, InsertionPointTy* ip) const {
std::vector<Value*> indices;
indices.reserve(2);
indices.push_back(ConstantUInt::get(Type::UIntTy, 0));
indices.push_back(ConstantUInt::get(Type::UIntTy, 1));
- return new GetElementPtrInst(arrayRef, indices, TMP, currentBB_);
+ return new GetElementPtrInst(arrayRef, indices, TMP, ip);
}
- Value* getArrayObjectBasePtr(Value* arrayRef) const {
+ template <typename InsertionPointTy>
+ Value* getArrayObjectBasePtr(Value* arrayRef, InsertionPointTy* ip) const {
std::vector<Value*> indices;
indices.reserve(2);
indices.push_back(ConstantUInt::get(Type::UIntTy, 0));
indices.push_back(ConstantUInt::get(Type::UIntTy, 0));
- return new GetElementPtrInst(arrayRef, indices, TMP, currentBB_);
+ return new GetElementPtrInst(arrayRef, indices, TMP, ip);
}
template<typename InsertionPointTy>
@@ -2294,7 +2296,7 @@
objRef = new CastInst(objRef, PointerType::get(ci.getType()), TMP, ip);
// Store the size.
- Value* lengthPtr = getArrayLengthPtr(objRef);
+ Value* lengthPtr = getArrayLengthPtr(objRef, ip);
new StoreInst(count, lengthPtr, ip);
// Install the vtable pointer.
@@ -2330,7 +2332,7 @@
void do_arraylength() {
const ClassInfo& ci = getObjectArrayInfo();
Value* arrayRef = pop(PointerType::get(ci.getType()));
- Value* lengthPtr = getArrayLengthPtr(arrayRef);
+ Value* lengthPtr = getArrayLengthPtr(arrayRef, currentBB_);
Value* length = new LoadInst(lengthPtr, TMP, currentBB_);
push(length);
}
More information about the llvm-commits
mailing list