From 01d6c1840defb4d8927379426d3de991c9f4dd02 Mon Sep 17 00:00:00 2001 From: tarberd Date: Tue, 17 Aug 2021 23:44:40 -0300 Subject: [PATCH] Add missing type attribute api Fixes issue #19 by adding: LLVMCreateTypeAttribute; LLVMGetTypeAttributeValue; and LLVMIsTypeAttribute. --- src/core.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core.rs b/src/core.rs index 35adca2..7bb4e55 100644 --- a/src/core.rs +++ b/src/core.rs @@ -66,6 +66,16 @@ extern "C" { /// /// Returns 0 if none exists. pub fn LLVMGetEnumAttributeValue(A: LLVMAttributeRef) -> u64; + + /// Create a type attribute. + pub fn LLVMCreateTypeAttribute( + C: LLVMContextRef, + KindID: ::libc::c_uint, + type_ref: LLVMTypeRef, + ) -> LLVMAttributeRef; + /// Get the type attribute's value. + pub fn LLVMGetTypeAttributeValue(A: LLVMAttributeRef) -> LLVMTypeRef; + /// Create a string attribute. pub fn LLVMCreateStringAttribute( C: LLVMContextRef, @@ -86,6 +96,7 @@ extern "C" { ) -> *const ::libc::c_char; pub fn LLVMIsEnumAttribute(A: LLVMAttributeRef) -> LLVMBool; pub fn LLVMIsStringAttribute(A: LLVMAttributeRef) -> LLVMBool; + pub fn LLVMIsTypeAttribute(A: LLVMAttributeRef) -> LLVMBool; /// Obtain a Type from a context by its registered name. pub fn LLVMGetTypeByName2(C: LLVMContextRef, Name: *const ::libc::c_char) -> LLVMTypeRef; -- GitLab