diff gen/statements.cpp @ 315:a9697749e898 trunk

[svn r336] Made sure calls within a landing pad area are invokes. Nested trys still need some consideration.
author ChristianK
date Thu, 03 Jul 2008 22:05:45 +0200
parents 8d98e42ece93
children e9c93739bc4c
line wrap: on
line diff
--- a/gen/statements.cpp	Wed Jul 02 22:20:18 2008 +0200
+++ b/gen/statements.cpp	Thu Jul 03 22:05:45 2008 +0200
@@ -713,7 +713,7 @@
     //Logger::cout() << "calling: " << *fn << '\n';
     LLValue* arg = DtoBitCast(e->getRVal(), fn->getFunctionType()->getParamType(0));
     //Logger::cout() << "arg: " << *arg << '\n';
-    gIR->ir->CreateCall(fn, arg, "");
+    gIR->CreateCallOrInvoke(fn, arg);
     gIR->ir->CreateUnreachable();
 
     // need a block after the throw for now
@@ -781,14 +781,14 @@
     }
     assert(llval->getType() == fn->getFunctionType()->getParamType(1));
 
-    llvm::CallInst* call = gIR->ir->CreateCall2(fn, table, llval, "tmp");
+    CallOrInvoke* call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp");
 
     llvm::PAListPtr palist;
     palist = palist.addAttr(1, llvm::ParamAttr::ByVal);
     palist = palist.addAttr(2, llvm::ParamAttr::ByVal);
     call->setParamAttrs(palist);
 
-    return call;
+    return call->get();
 }
 
 void SwitchStatement::toIR(IRState* p)