diff ir/irlandingpad.cpp @ 1571:8d086d552909

IntegerType is now contextifed. Requires llvm >= 78969. resistor says this will be the last context API change :)
author Benjamin Kramer <benny.kra@gmail.com>
date Fri, 14 Aug 2009 00:39:18 +0200
parents d6e8d5db259f
children f4c56ed32238
line wrap: on
line diff
--- a/ir/irlandingpad.cpp	Thu Aug 06 16:02:14 2009 +0200
+++ b/ir/irlandingpad.cpp	Fri Aug 14 00:39:18 2009 +0200
@@ -10,7 +10,7 @@
 IRLandingPadInfo::IRLandingPadInfo(Catch* catchstmt, llvm::BasicBlock* end)
 : finallyBody(NULL)
 {
-    target = llvm::BasicBlock::Create("catch", gIR->topfunc(), end);
+    target = llvm::BasicBlock::Create(gIR->context(), "catch", gIR->topfunc(), end);
     gIR->scope() = IRScope(target,end);
 
     // assign storage to catch var
@@ -133,11 +133,11 @@
     }
     // if there's a finally, the eh table has to have a 0 action
     if(hasFinally)
-        selectorargs.push_back(LLConstantInt::get(LLType::Int32Ty, 0));
+        selectorargs.push_back(LLConstantInt::get(LLType::getInt32Ty(gIR->context()), 0));
 
     // personality fn
     llvm::Function* personality_fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_eh_personality");
-    LLValue* personality_fn_arg = gIR->ir->CreateBitCast(personality_fn, getPtrToType(LLType::Int8Ty));
+    LLValue* personality_fn_arg = gIR->ir->CreateBitCast(personality_fn, getPtrToType(LLType::getInt8Ty(gIR->context())));
     selectorargs.insert(selectorargs.begin(), personality_fn_arg);
 
     // eh storage target
@@ -181,7 +181,7 @@
         {
             if(!switchinst)
             {
-                switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create("switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size());
+                switchinst = gIR->ir->CreateSwitch(eh_sel, llvm::BasicBlock::Create(gIR->context(), "switchdefault", gIR->topfunc(), gIR->scopeend()), infos.size());
                 gIR->scope() = IRScope(switchinst->getDefaultDest(), gIR->scopeend());
             }
             // dubious comment