[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Thu Feb 3 00:01:58 PST 2005
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.211 -> 1.212
---
Log message:
Zero initialize arrays as well. This fixes Maps1.java.
---
Diffs of the changes: (+7 -0)
Compiler.cpp | 7 +++++++
1 files changed, 7 insertions(+)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.211 llvm-java/lib/Compiler/Compiler.cpp:1.212
--- llvm-java/lib/Compiler/Compiler.cpp:1.211 Wed Feb 2 10:26:54 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Thu Feb 3 02:01:47 2005
@@ -2281,6 +2281,13 @@
Instruction::Add, size, arrayObjectSize, TMP, currentBB_);
// Allocate memory for the object.
Value* objRef = new MallocInst(Type::SByteTy, size, TMP, currentBB_);
+ std::vector<Value*> params;
+ params.reserve(4);
+ params.push_back(objRef); // dest
+ params.push_back(ConstantUInt::get(Type::UByteTy, 0)); // value
+ params.push_back(new CastInst(size, Type::ULongTy, TMP, currentBB_)); // size
+ params.push_back(ConstantUInt::get(Type::UIntTy, 0)); // alignment
+ new CallInst(memset_, params, "", currentBB_);
objRef = new CastInst(objRef, PointerType::get(ci.getType()), TMP, currentBB_);
// Store the size.
More information about the llvm-commits
mailing list