diff options
| author | bors <bors@rust-lang.org> | 2025-05-12 17:39:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-05-12 17:39:21 +0000 |
| commit | 1a7f290a9aedc138edf9c88a82019292019754d9 (patch) | |
| tree | 4746f5f00e66e349bd24cd7625b5043728be8879 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 420ca7104f4db107837cba4d8e48a82c53fcb76c (diff) | |
| parent | eccf0647d3dfcef826a40fdcc7cde279ea154eaf (diff) | |
| download | rust-1a7f290a9aedc138edf9c88a82019292019754d9.tar.gz rust-1a7f290a9aedc138edf9c88a82019292019754d9.zip | |
Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
cg_llvm: Clean up some inline assembly bindings This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include: - Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm` - Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions - Flattening control flow in `inline_asm_call` There should be no functional changes.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 72369ab7b69..90aa9188c83 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -622,37 +622,10 @@ extern "C" LLVMValueRef LLVMRustBuildAtomicStore(LLVMBuilderRef B, return wrap(SI); } -enum class LLVMRustAsmDialect { - Att, - Intel, -}; - -static InlineAsm::AsmDialect fromRust(LLVMRustAsmDialect Dialect) { - switch (Dialect) { - case LLVMRustAsmDialect::Att: - return InlineAsm::AD_ATT; - case LLVMRustAsmDialect::Intel: - return InlineAsm::AD_Intel; - default: - report_fatal_error("bad AsmDialect."); - } -} - extern "C" uint64_t LLVMRustGetArrayNumElements(LLVMTypeRef Ty) { return unwrap(Ty)->getArrayNumElements(); } -extern "C" LLVMValueRef -LLVMRustInlineAsm(LLVMTypeRef Ty, char *AsmString, size_t AsmStringLen, - char *Constraints, size_t ConstraintsLen, - LLVMBool HasSideEffects, LLVMBool IsAlignStack, - LLVMRustAsmDialect Dialect, LLVMBool CanThrow) { - return wrap(InlineAsm::get( - unwrap<FunctionType>(Ty), StringRef(AsmString, AsmStringLen), - StringRef(Constraints, ConstraintsLen), HasSideEffects, IsAlignStack, - fromRust(Dialect), CanThrow)); -} - extern "C" bool LLVMRustInlineAsmVerify(LLVMTypeRef Ty, char *Constraints, size_t ConstraintsLen) { // llvm::Error converts to true if it is an error. |
