diff options
| author | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-01 04:05:49 +0000 |
|---|---|---|
| committer | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-01 04:05:49 +0000 |
| commit | 560de7e51225559aa329d296f5ff0e9f95cbdf48 (patch) | |
| tree | e0389ca43c9774070bd6259df2f482f863e6a243 /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | 27eb27423382738ae8f6d3d40a96396c7c541a37 (diff) | |
| parent | 0c33fe2c3d3eecadd17a84b110bb067288a64f1c (diff) | |
| download | rust-560de7e51225559aa329d296f5ff0e9f95cbdf48.tar.gz rust-560de7e51225559aa329d296f5ff0e9f95cbdf48.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/mod.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs index 6ca81c651ed..d14aab06073 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs @@ -41,6 +41,32 @@ pub(crate) fn AddFunctionAttributes<'ll>( } } +pub(crate) fn HasAttributeAtIndex<'ll>( + llfn: &'ll Value, + idx: AttributePlace, + kind: AttributeKind, +) -> bool { + unsafe { LLVMRustHasAttributeAtIndex(llfn, idx.as_uint(), kind) } +} + +pub(crate) fn HasStringAttribute<'ll>(llfn: &'ll Value, name: &str) -> bool { + unsafe { LLVMRustHasFnAttribute(llfn, name.as_c_char_ptr(), name.len()) } +} + +pub(crate) fn RemoveStringAttrFromFn<'ll>(llfn: &'ll Value, name: &str) { + unsafe { LLVMRustRemoveFnAttribute(llfn, name.as_c_char_ptr(), name.len()) } +} + +pub(crate) fn RemoveRustEnumAttributeAtIndex( + llfn: &Value, + place: AttributePlace, + kind: AttributeKind, +) { + unsafe { + LLVMRustRemoveEnumAttributeAtIndex(llfn, place.as_uint(), kind); + } +} + pub(crate) fn AddCallSiteAttributes<'ll>( callsite: &'ll Value, idx: AttributePlace, |
