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 | 1ef9ca4442c8eb5086b4e310792847f5a4a996de (patch) | |
tree | 46f06738a010b11d7481868f9e1f5f8cb1b24073 /lib/Bytecode/Writer | |
parent | 44bd331c225f580e56632b4479239b2e6f688002 (diff) |
only one client of getOrCreateSlot can pass a void typed value. Check type
there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34119 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer')
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 8de1d67f29..bb21a5f697 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/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; |