diff options
| author | Tshepang Mbambo <tshepang@gmail.com> | 2025-05-01 07:01:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-01 07:01:46 +0200 |
| commit | bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55 (patch) | |
| tree | a974f5bc634539b226397f38dd8f69c35fbee719 /compiler/rustc_codegen_llvm/src/llvm/mod.rs | |
| parent | 9ce6c52c707b8d0dba9c0d5c4828cc9443dd8f4c (diff) | |
| parent | 560de7e51225559aa329d296f5ff0e9f95cbdf48 (diff) | |
| download | rust-bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55.tar.gz rust-bf06eaf7a2e8ad08c23a3d8da1255cdcc4174c55.zip | |
Merge pull request #2367 from rust-lang/rustc-pull
Rustc pull update
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, |
