only one client of getOrCreateSlot can pass a void typed value. Check type
authorChris Lattner <sabre@nondot.org>
Sat, 10 Feb 2007 04:31:52 +0000 (04:31 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 10 Feb 2007 04:31:52 +0000 (04:31 +0000)
there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34119 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Writer/SlotCalculator.cpp

index 8de1d67f2924b1e4bc0f52ad7dc0588eaa0c587e..bb21a5f6970f873f579902e87aeb90265f008f09 100644 (file)
@@ -261,7 +261,8 @@ void SlotCalculator::incorporateFunction(const Function *F) {
   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::getTypeSlot(const Type*T) const {
 
 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;