about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-29 02:29:56 +0000
committerbors <bors@rust-lang.org>2025-04-29 02:29:56 +0000
commit1b8ab72680f36e783af84c1a3c4f8508572bd9f9 (patch)
tree45a5fa6de1b388f0098b401c8c4daa1727ec56c7 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent25cdf1f67463c9365d8d83778c933ec7480e940b (diff)
parentbf37847434acfc691553540b5bf0b8cffc09c277 (diff)
downloadrust-1b8ab72680f36e783af84c1a3c4f8508572bd9f9.tar.gz
rust-1b8ab72680f36e783af84c1a3c4f8508572bd9f9.zip
Auto merge of #140415 - ChrisDenton:rollup-r0631fv, r=ChrisDenton
Rollup of 10 pull requests

Successful merges:

 - #139308 (add autodiff inline)
 - #139656 (Stabilize `slice_as_chunks` library feature)
 - #140022 (allow deref patterns to move out of boxes)
 - #140276 (Do not compute type_of for impl item if impl where clauses are unsatisfied)
 - #140302 (Move inline asm check to typeck, properly handle aliases)
 - #140323 (Implement the internal feature `cfg_target_has_reliable_f16_f128`)
 - #140391 (Rename sub_ptr to offset_from_unsigned in docs)
 - #140394 (Make bootstrap git tests more self-contained)
 - #140396 (Workaround for windows-gnu rust-lld test failure)
 - #140402 (only return nested goals for `Certainty::Yes`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index 5f0e4d745e8..72369ab7b69 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -973,6 +973,27 @@ extern "C" LLVMMetadataRef LLVMRustDIGetInstMetadata(LLVMValueRef x) {
   return nullptr;
 }
 
+extern "C" void
+LLVMRustRemoveEnumAttributeAtIndex(LLVMValueRef F, size_t index,
+                                   LLVMRustAttributeKind RustAttr) {
+  LLVMRemoveEnumAttributeAtIndex(F, index, fromRust(RustAttr));
+}
+
+extern "C" bool LLVMRustHasFnAttribute(LLVMValueRef F, const char *Name,
+                                       size_t NameLen) {
+  if (auto *Fn = dyn_cast<Function>(unwrap<Value>(F))) {
+    return Fn->hasFnAttribute(StringRef(Name, NameLen));
+  }
+  return false;
+}
+
+extern "C" void LLVMRustRemoveFnAttribute(LLVMValueRef Fn, const char *Name,
+                                          size_t NameLen) {
+  if (auto *F = dyn_cast<Function>(unwrap<Value>(Fn))) {
+    F->removeFnAttr(StringRef(Name, NameLen));
+  }
+}
+
 extern "C" void LLVMRustGlobalAddMetadata(LLVMValueRef Global, unsigned Kind,
                                           LLVMMetadataRef MD) {
   unwrap<GlobalObject>(Global)->addMetadata(Kind, *unwrap<MDNode>(MD));