Mercurial > projects > ldc
comparison gen/llvmhelpers.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 | 45ed9e125a00 |
children | e8c6dbcd33d1 |
comparison
equal
deleted
inserted
replaced
1012:39cf8fa483fd | 1013:8c73ff5f69e0 |
---|---|
35 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_allocmemoryT"); | 35 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, "_d_allocmemoryT"); |
36 // get type info | 36 // get type info |
37 LLConstant* ti = DtoTypeInfoOf(newtype); | 37 LLConstant* ti = DtoTypeInfoOf(newtype); |
38 assert(isaPointer(ti)); | 38 assert(isaPointer(ti)); |
39 // call runtime allocator | 39 // call runtime allocator |
40 LLValue* mem = gIR->CreateCallOrInvoke(fn, ti, ".gc_mem")->get(); | 40 LLValue* mem = gIR->CreateCallOrInvoke(fn, ti, ".gc_mem").getInstruction(); |
41 // cast | 41 // cast |
42 return DtoBitCast(mem, getPtrToType(DtoType(newtype)), ".gc_mem"); | 42 return DtoBitCast(mem, getPtrToType(DtoType(newtype)), ".gc_mem"); |
43 } | 43 } |
44 | 44 |
45 void DtoDeleteMemory(LLValue* ptr) | 45 void DtoDeleteMemory(LLValue* ptr) |
134 // line param | 134 // line param |
135 LLConstant* c = DtoConstUint(loc->linnum); | 135 LLConstant* c = DtoConstUint(loc->linnum); |
136 args.push_back(c); | 136 args.push_back(c); |
137 | 137 |
138 // call | 138 // call |
139 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); | 139 gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); |
140 | 140 |
141 // end debug info | 141 // end debug info |
142 if (global.params.symdebug) | 142 if (global.params.symdebug) |
143 DtoDwarfFuncEnd(gIR->func()->decl); | 143 DtoDwarfFuncEnd(gIR->func()->decl); |
144 | 144 |