Mercurial > projects > ldc
comparison gen/statements.cpp @ 1013:8c73ff5f69e0
Use llvm::CallSite instead of custom CallOrInvoke class.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Sat, 28 Feb 2009 22:16:52 +0100 |
parents | 18ad5601dff7 |
children | 9167d492cbc2 |
comparison
equal
deleted
inserted
replaced
1012:39cf8fa483fd | 1013:8c73ff5f69e0 |
---|---|
734 | 734 |
735 DValue* val = e->toElem(gIR); | 735 DValue* val = e->toElem(gIR); |
736 LLValue* llval = val->getRVal(); | 736 LLValue* llval = val->getRVal(); |
737 assert(llval->getType() == fn->getFunctionType()->getParamType(1)); | 737 assert(llval->getType() == fn->getFunctionType()->getParamType(1)); |
738 | 738 |
739 CallOrInvoke* call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp"); | 739 LLCallSite call = gIR->CreateCallOrInvoke2(fn, table, llval, "tmp"); |
740 | 740 |
741 return call->get(); | 741 return call.getInstruction(); |
742 } | 742 } |
743 | 743 |
744 void SwitchStatement::toIR(IRState* p) | 744 void SwitchStatement::toIR(IRState* p) |
745 { | 745 { |
746 Logger::println("SwitchStatement::toIR(): %s", loc.toChars()); | 746 Logger::println("SwitchStatement::toIR(): %s", loc.toChars()); |
1436 // line param | 1436 // line param |
1437 LLConstant* c = DtoConstUint(loc.linnum); | 1437 LLConstant* c = DtoConstUint(loc.linnum); |
1438 args.push_back(c); | 1438 args.push_back(c); |
1439 | 1439 |
1440 // call | 1440 // call |
1441 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); | 1441 gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); |
1442 | 1442 |
1443 gIR->ir->CreateUnreachable(); | 1443 gIR->ir->CreateUnreachable(); |
1444 } | 1444 } |
1445 | 1445 |
1446 ////////////////////////////////////////////////////////////////////////////// | 1446 ////////////////////////////////////////////////////////////////////////////// |