diff options
| author | bors <bors@rust-lang.org> | 2024-03-09 11:34:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-09 11:34:34 +0000 |
| commit | 0ebb78fb7ba8df84352c51c999e4464ef1f6cee0 (patch) | |
| tree | b00f304065840da48022bd7426379397a2f7e861 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | b0fad9accbffe670f6bb4259cc087b3d883dad77 (diff) | |
| parent | 862f918fa484c680b926463c0cad3236a2eeffed (diff) | |
| download | rust-0ebb78fb7ba8df84352c51c999e4464ef1f6cee0.tar.gz rust-0ebb78fb7ba8df84352c51c999e4464ef1f6cee0.zip | |
Auto merge of #3367 - rust-lang:rustup-2024-03-09, r=RalfJung
Automatic Rustup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index d9262a92782..3e998d428ee 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -1549,6 +1549,31 @@ LLVMRustBuildInvoke(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, Name)); } +extern "C" LLVMValueRef +LLVMRustBuildCallBr(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, + LLVMBasicBlockRef DefaultDest, + LLVMBasicBlockRef *IndirectDests, unsigned NumIndirectDests, + LLVMValueRef *Args, unsigned NumArgs, + OperandBundleDef **OpBundles, unsigned NumOpBundles, + const char *Name) { + Value *Callee = unwrap(Fn); + FunctionType *FTy = unwrap<FunctionType>(Ty); + + // FIXME: Is there a way around this? + std::vector<BasicBlock*> IndirectDestsUnwrapped; + IndirectDestsUnwrapped.reserve(NumIndirectDests); + for (unsigned i = 0; i < NumIndirectDests; ++i) { + IndirectDestsUnwrapped.push_back(unwrap(IndirectDests[i])); + } + + return wrap(unwrap(B)->CreateCallBr( + FTy, Callee, unwrap(DefaultDest), + ArrayRef<BasicBlock*>(IndirectDestsUnwrapped), + ArrayRef<Value*>(unwrap(Args), NumArgs), + ArrayRef<OperandBundleDef>(*OpBundles, NumOpBundles), + Name)); +} + extern "C" void LLVMRustPositionBuilderAtStart(LLVMBuilderRef B, LLVMBasicBlockRef BB) { auto Point = unwrap(BB)->getFirstInsertionPt(); |
