1
Fork 0

Support x86 stdcall convention

This allows rust to call the Win32 API
This commit is contained in:
Brian Anderson 2011-07-18 13:14:33 -07:00
parent 682875929e
commit c40d6265ce
7 changed files with 61 additions and 6 deletions

View file

@ -1314,6 +1314,15 @@ obj builder(BuilderRef B, @mutable bool terminated) {
ret v;
}
fn CallWithConv(ValueRef Fn, &ValueRef[] Args,
uint Conv) -> ValueRef {
assert !(*terminated);
auto v = llvm::LLVMBuildCall(B, Fn, ivec::to_ptr(Args),
ivec::len(Args), str::buf(""));
llvm::LLVMSetInstructionCallConv(v, Conv);
ret v;
}
fn Select(ValueRef If, ValueRef Then, ValueRef Else) -> ValueRef {
assert (!*terminated);
ret llvm::LLVMBuildSelect(B, If, Then, Else, str::buf(""));