[llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp

Chris Lattner sabre at nondot.org
Fri Feb 9 20:32:08 PST 2007



Changes in directory llvm/lib/Bytecode/Writer:

SlotCalculator.cpp updated: 1.90 -> 1.91
---
Log message:

only one client of getOrCreateSlot can pass a void typed value.  Check type
there.


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

 SlotCalculator.cpp |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.90 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.91
--- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.90	Fri Feb  9 22:29:03 2007
+++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp	Fri Feb  9 22:31:52 2007
@@ -261,7 +261,8 @@
   for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
     getOrCreateSlot(BB);
     for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
-      getOrCreateSlot(I);
+      if (I->getType() != Type::VoidTy)
+        getOrCreateSlot(I);
     }
   }
 
@@ -332,7 +333,7 @@
 
 int SlotCalculator::getOrCreateSlot(const Value *V) {
   const Type *Ty = V->getType();
-  if (Ty == Type::VoidTy) return -1;
+  assert(Ty != Type::VoidTy && "Can't insert void values!");
 
   int SlotNo = getSlot(V);        // Check to see if it's already in!
   if (SlotNo != -1) return SlotNo;






More information about the llvm-commits mailing list