Skip to content

Commit

Permalink
fix(llvm) LLVMLookupIntrinsicID return type
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneAlex authored and Spasi committed Dec 2, 2023
1 parent b428b2f commit df470a4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
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

0 comments on commit df470a4

Please sign in to comment.