Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(llvm) change return type of LLVMLookupIntrinsicID function(s) in generated bindings from void to (unsigned) int #950

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/notes/3.3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This build includes the following changes:

- Core: Fixed callback wrapper memory leak with the CHM closure registry. (#927)
- LLVM: Fixed `LLVMGetBufferStart` to return `ByteBuffer` instead of `String`. (#934)
- LLVM: Fixed `LookupIntrinsicID` to return `unsigned` instead of `void`. (#950)
- tinyfd: The `aDefaultPath` parameter of `tinyfd_selectFolderDialog` is now nullable. (#922)

#### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7907,34 +7907,36 @@ public static void LLVMSetPersonalityFn(@NativeType("LLVMValueRef") long Fn, @Na
// --- [ LLVMLookupIntrinsicID ] ---

/** Unsafe version of: {@link #LLVMLookupIntrinsicID LookupIntrinsicID} */
public static void nLLVMLookupIntrinsicID(long Name, long NameLen) {
public static int nLLVMLookupIntrinsicID(long Name, long NameLen) {
long __functionAddress = Functions.LookupIntrinsicID;
if (CHECKS) {
check(__functionAddress);
}
invokePPV(Name, NameLen, __functionAddress);
return invokePPI(Name, NameLen, __functionAddress);
}

/**
* Obtain the intrinsic ID number which matches the given function name.
*
* @since 9
*/
public static void LLVMLookupIntrinsicID(@NativeType("char const *") ByteBuffer Name) {
nLLVMLookupIntrinsicID(memAddress(Name), Name.remaining());
@NativeType("unsigned int")
public static int LLVMLookupIntrinsicID(@NativeType("char const *") ByteBuffer Name) {
return nLLVMLookupIntrinsicID(memAddress(Name), Name.remaining());
}

/**
* Obtain the intrinsic ID number which matches the given function name.
*
* @since 9
*/
public static void LLVMLookupIntrinsicID(@NativeType("char const *") CharSequence Name) {
@NativeType("unsigned int")
public static int LLVMLookupIntrinsicID(@NativeType("char const *") CharSequence Name) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
int NameEncodedLength = stack.nUTF8(Name, false);
long NameEncoded = stack.getPointerAddress();
nLLVMLookupIntrinsicID(NameEncoded, NameEncodedLength);
return nLLVMLookupIntrinsicID(NameEncoded, NameEncodedLength);
} finally {
stack.setPointer(stackPointer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3233,7 +3233,7 @@ val LLVMCore = "LLVMCore".nativeClass(
LLVMValueRef("PersonalityFn", "")
)

IgnoreMissing..void(
IgnoreMissing..unsigned_int(
"LookupIntrinsicID",
"Obtain the intrinsic ID number which matches the given function name.",

Expand Down