Package org.lwjgl.llvm
Class LLVMOptRemarks
- java.lang.Object
-
- org.lwjgl.llvm.LLVMOptRemarks
-
public class LLVMOptRemarks extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LLVMOptRemarks.Functions
Contains the function pointers loaded fromLLVMCore.getLibrary()
.
-
Field Summary
Fields Modifier and Type Field Description static int
OPT_REMARKS_API_VERSION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
LLVMOptRemarkParserCreate(java.nio.ByteBuffer Buf)
Creates a remark parser that can be used to read and parse the buffer located inBuf
of sizeSize
.static void
LLVMOptRemarkParserDispose(long Parser)
Releases all the resources used byParser
.static java.lang.String
LLVMOptRemarkParserGetErrorMessage(long Parser)
Returns a null-terminated string containing an error message.static LLVMOptRemarkEntry
LLVMOptRemarkParserGetNext(long Parser)
Returns the next remark in the file.static boolean
LLVMOptRemarkParserHasError(long Parser)
Returns1
if the parser encountered an error while parsing the buffer.static int
LLVMOptRemarkVersion()
Returns the version of the opt-remarks dylib.static long
nLLVMOptRemarkParserCreate(long Buf, long Size)
Unsafe version of:OptRemarkParserCreate
static long
nLLVMOptRemarkParserGetErrorMessage(long Parser)
Unsafe version of:OptRemarkParserGetErrorMessage
static long
nLLVMOptRemarkParserGetNext(long Parser)
Unsafe version of:OptRemarkParserGetNext
-
-
-
Field Detail
-
OPT_REMARKS_API_VERSION
public static final int OPT_REMARKS_API_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
nLLVMOptRemarkParserCreate
public static long nLLVMOptRemarkParserCreate(long Buf, long Size)
Unsafe version of:OptRemarkParserCreate
-
LLVMOptRemarkParserCreate
public static long LLVMOptRemarkParserCreate(java.nio.ByteBuffer Buf)
Creates a remark parser that can be used to read and parse the buffer located inBuf
of sizeSize
.Buf
cannot beNULL
.This function should be paired with
OptRemarkParserDispose
to avoid leaking resources.
-
nLLVMOptRemarkParserGetNext
public static long nLLVMOptRemarkParserGetNext(long Parser)
Unsafe version of:OptRemarkParserGetNext
-
LLVMOptRemarkParserGetNext
@Nullable public static LLVMOptRemarkEntry LLVMOptRemarkParserGetNext(long Parser)
Returns the next remark in the file.The value pointed to by the return value is invalidated by the next call to
OptRemarkParserGetNext
.If the parser reaches the end of the buffer, the return value will be
NULL
.In the case of an error, the return value will be
NULL
, and:OptRemarkParserHasError
will return1
.OptRemarkParserGetErrorMessage
will return a descriptive error message.
An error may occur if:
- An argument is invalid.
- There is a YAML parsing error. This type of error aborts parsing immediately and returns
1
. It can occur on malformed YAML. - Remark parsing error. If this type of error occurs, the parser won't call the handler and will continue to the next one. It can occur on malformed remarks, like missing or extra fields in the file.
Here is a quick example of the usage:
LLVMOptRemarkParserRef Parser = LLVMOptRemarkParserCreate(Buf, Size); LLVMOptRemarkEntry *Remark = NULL; while ((Remark == LLVMOptRemarkParserGetNext(Parser))) { // use Remark } bool HasError = LLVMOptRemarkParserHasError(Parser); LLVMOptRemarkParserDispose(Parser);
-
LLVMOptRemarkParserHasError
public static boolean LLVMOptRemarkParserHasError(long Parser)
Returns1
if the parser encountered an error while parsing the buffer.
-
nLLVMOptRemarkParserGetErrorMessage
public static long nLLVMOptRemarkParserGetErrorMessage(long Parser)
Unsafe version of:OptRemarkParserGetErrorMessage
-
LLVMOptRemarkParserGetErrorMessage
@Nullable public static java.lang.String LLVMOptRemarkParserGetErrorMessage(long Parser)
Returns a null-terminated string containing an error message.In case of no error, the result is
NULL
.The memory of the string is bound to the lifetime of
Parser
. IfOptRemarkParserDispose
is called, the memory of the string will be released.
-
LLVMOptRemarkParserDispose
public static void LLVMOptRemarkParserDispose(long Parser)
Releases all the resources used byParser
.
-
LLVMOptRemarkVersion
public static int LLVMOptRemarkVersion()
Returns the version of the opt-remarks dylib.- Since:
- 8.0
-
-