Mercurial > projects > ldc
comparison ir/irlandingpad.cpp @ 1554:d6e8d5db259f
LLVMContext changes up to r77366
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 30 Jul 2009 15:25:10 +0200 |
parents | 7fcb72d518f6 |
children | 8d086d552909 |
comparison
equal
deleted
inserted
replaced
1553:f55ca8a1598c | 1554:d6e8d5db259f |
---|---|
131 selectorargs.insert(selectorargs.begin(), it->catchType->ir.irStruct->getClassInfoSymbol()); | 131 selectorargs.insert(selectorargs.begin(), it->catchType->ir.irStruct->getClassInfoSymbol()); |
132 } | 132 } |
133 } | 133 } |
134 // if there's a finally, the eh table has to have a 0 action | 134 // if there's a finally, the eh table has to have a 0 action |
135 if(hasFinally) | 135 if(hasFinally) |
136 selectorargs.push_back(gIR->context().getConstantInt(LLType::Int32Ty, 0)); | 136 selectorargs.push_back(LLConstantInt::get(LLType::Int32Ty, 0)); |
137 | 137 |
138 // personality fn | 138 // personality fn |
139 llvm::Function* personality_fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_eh_personality"); | 139 llvm::Function* personality_fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_eh_personality"); |
140 LLValue* personality_fn_arg = gIR->ir->CreateBitCast(personality_fn, getPtrToType(LLType::Int8Ty)); | 140 LLValue* personality_fn_arg = gIR->ir->CreateBitCast(personality_fn, getPtrToType(LLType::Int8Ty)); |
141 selectorargs.insert(selectorargs.begin(), personality_fn_arg); | 141 selectorargs.insert(selectorargs.begin(), personality_fn_arg); |
184 switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create("switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size()); | 184 switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create("switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size()); |
185 gIR->scope() = IRScope(switchinst->getDefaultDest(), gIR->scopeend()); | 185 gIR->scope() = IRScope(switchinst->getDefaultDest(), gIR->scopeend()); |
186 } | 186 } |
187 // dubious comment | 187 // dubious comment |
188 // catches matched first get the largest switchval, so do size - unique int | 188 // catches matched first get the largest switchval, so do size - unique int |
189 llvm::ConstantInt* switchval = gIR->context().getConstantInt(DtoSize_t(), catchToInt[rit->catchType]); | 189 llvm::ConstantInt* switchval = LLConstantInt::get(DtoSize_t(), catchToInt[rit->catchType]); |
190 // and make sure we don't add the same switchval twice, may happen with nested trys | 190 // and make sure we don't add the same switchval twice, may happen with nested trys |
191 if(!switchinst->findCaseValue(switchval)) | 191 if(!switchinst->findCaseValue(switchval)) |
192 switchinst->addCase(switchval, rit->target); | 192 switchinst->addCase(switchval, rit->target); |
193 } | 193 } |
194 } | 194 } |