comparison ir/irlandingpad.cpp @ 349:d22d8d63c1fd trunk

[svn r370] Fixed landing pads on 64bit was broken (hardcoded 32bit type, should be size_t)
author lindquist
date Sun, 13 Jul 2008 21:41:45 +0200
parents d7e6ace5cca4
children d8357f7004ca
comparison
equal deleted inserted replaced
348:3c5e19bfcbf2 349:d22d8d63c1fd
159 { 159 {
160 switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create("switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size()); 160 switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create("switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size());
161 gIR->scope() = IRScope(switchinst->getDefaultDest(), gIR->scopeend()); 161 gIR->scope() = IRScope(switchinst->getDefaultDest(), gIR->scopeend());
162 } 162 }
163 // catches matched first get the largest switchval, so do size - unique int 163 // catches matched first get the largest switchval, so do size - unique int
164 llvm::ConstantInt* switchval = llvm::ConstantInt::get(LLType::Int32Ty, catchToInt.size() - catchToInt[it->catchType]); 164 llvm::ConstantInt* switchval = llvm::ConstantInt::get(DtoSize_t(), catchToInt.size() - catchToInt[it->catchType]);
165 // and make sure we don't add the same switchval twice, may happen with nested trys 165 // and make sure we don't add the same switchval twice, may happen with nested trys
166 if(!switchinst->findCaseValue(switchval)) 166 if(!switchinst->findCaseValue(switchval))
167 switchinst->addCase(switchval, it->target); 167 switchinst->addCase(switchval, it->target);
168 } 168 }
169 } 169 }