Support x86 stdcall convention
This allows rust to call the Win32 API
This commit is contained in:
parent
682875929e
commit
c40d6265ce
7 changed files with 61 additions and 6 deletions
|
@ -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(""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue