diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-10 04:31:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-10 04:31:52 +0000 |
commit | c7627ca239a1477bd34c8c6ac7ab997a2d21785b (patch) | |
tree | f945cbe9e701a5e4c3fceaea180d319fdd29594b /llvm/lib/Bytecode | |
parent | 3a28413d388115638cc5277275dafe686c27ed75 (diff) | |
download | bcm5719-llvm-c7627ca239a1477bd34c8c6ac7ab997a2d21785b.tar.gz bcm5719-llvm-c7627ca239a1477bd34c8c6ac7ab997a2d21785b.zip |
only one client of getOrCreateSlot can pass a void typed value. Check type
there.
llvm-svn: 34119
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp index 8de1d67f292..bb21a5f6970 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp @@ -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; |