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

Alkis Evlogimenos alkis at cs.uiuc.edu
Tue May 25 14:42:01 PDT 2004


Changes in directory llvm-java/lib/Compiler:

Compiler.cpp updated: 1.24 -> 1.25

---
Log message:

Fix some serious type bugs when creating and initializing locals variables.


---
Diffs of the changes:  (+2 -2)

Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.24 llvm-java/lib/Compiler/Compiler.cpp:1.25
--- llvm-java/lib/Compiler/Compiler.cpp:1.24	Tue May 25 14:38:05 2004
+++ llvm-java/lib/Compiler/Compiler.cpp	Tue May 25 14:39:29 2004
@@ -117,7 +117,7 @@
             switch (type) {
                 // FIXME: this should really be a non-void type when the object
                 // model is finalized
-            case REFERENCE: return Type::VoidTy;
+            case REFERENCE: return PointerType::get(Type::VoidTy);
             case BOOLEAN: return Type::BoolTy;
             case CHAR: return Type::UByteTy;
             case FLOAT: return Type::FloatTy;
@@ -165,7 +165,7 @@
                     new AllocaInst(type, NULL, "local" + utostr(index));
                 locals_[index] = alloc;
                 Instruction* store = new StoreInst(
-                    llvm::Constant::getNullValue(alloc->getType()), alloc);
+                    llvm::Constant::getNullValue(type), alloc);
                 entry->getInstList().push_front(store);
                 entry->getInstList().push_front(alloc);
             }





More information about the llvm-commits mailing list