Class LLVMRemarks
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContains the function pointers loaded fromLLVMCore.getLibrary(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe type of the emitted remark.static final intThe type of the emitted remark.static final intThe type of the emitted remark.static final intThe type of the emitted remark.static final intThe type of the emitted remark.static final intThe type of the emitted remark.static final intThe type of the emitted remark.static final int -
Method Summary
Modifier and TypeMethodDescriptionstatic longLLVMRemarkArgGetDebugLoc(long Arg) Returns the debug location that is attached to the value of this argument.static longLLVMRemarkArgGetKey(long Arg) Returns the key of an argument.static longLLVMRemarkArgGetValue(long Arg) Returns the value of an argument.static intLLVMRemarkDebugLocGetSourceColumn(long DL) Return the column in the source file for a debug location.static longLLVMRemarkDebugLocGetSourceFilePath(long DL) Return the path to the source file for a debug location.static intLLVMRemarkDebugLocGetSourceLine(long DL) Return the line in the source file for a debug location.static voidLLVMRemarkEntryDispose(long Remark) Free the resources used by the remark entry.static longLLVMRemarkEntryGetDebugLoc(long Remark) Returns the debug location that is attached to this remark.static longLLVMRemarkEntryGetFirstArg(long Remark) Get a new iterator to iterate over a remark's argument.static longLLVMRemarkEntryGetFunctionName(long Remark) Get the name of the function being processed when the remark was emitted.static longLLVMRemarkEntryGetHotness(long Remark) Return the hotness of the remark.static longLLVMRemarkEntryGetNextArg(long It, long Remark) Get the next argument inRemarkfrom the position ofIt.static intLLVMRemarkEntryGetNumArgs(long Remark) The number of arguments the remark holds.static longLLVMRemarkEntryGetPassName(long Remark) Get the name of the pass that emitted this remark.static longLLVMRemarkEntryGetRemarkName(long Remark) Get an identifier of the remark.static intLLVMRemarkEntryGetType(long Remark) The type of the remark.static longCreates a remark parser that can be used to parse the buffer located inBufof sizeSizebytes.static longCreates a remark parser that can be used to parse the buffer located inBufof sizeSizebytes.static voidLLVMRemarkParserDispose(long Parser) Releases all the resources used byParser.static @Nullable StringLLVMRemarkParserGetErrorMessage(long Parser) Returns a null-terminated string containing an error message.static longLLVMRemarkParserGetNext(long Parser) Returns the next remark in the file.static booleanLLVMRemarkParserHasError(long Parser) Returns1if the parser encountered an error while parsing the buffer.static @Nullable StringLLVMRemarkStringGetData(long String) Returns the buffer holding the string.static intLLVMRemarkStringGetLen(long String) Returns the size of the string.static intReturns the version of the remarks library.static longnLLVMRemarkParserCreateBitstream(long Buf, long Size) Unsafe version of:RemarkParserCreateBitstreamstatic longnLLVMRemarkParserCreateYAML(long Buf, long Size) Unsafe version of:RemarkParserCreateYAMLstatic longnLLVMRemarkParserGetErrorMessage(long Parser) Unsafe version of:RemarkParserGetErrorMessagestatic longnLLVMRemarkStringGetData(long String) Unsafe version of:RemarkStringGetData
-
Field Details
-
REMARKS_API_VERSION
public static final int REMARKS_API_VERSION- See Also:
-
LLVMRemarkTypeUnknown
public static final int LLVMRemarkTypeUnknownThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypePassed
public static final int LLVMRemarkTypePassedThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypeMissed
public static final int LLVMRemarkTypeMissedThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypeAnalysis
public static final int LLVMRemarkTypeAnalysisThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypeAnalysisFPCommute
public static final int LLVMRemarkTypeAnalysisFPCommuteThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypeAnalysisAliasing
public static final int LLVMRemarkTypeAnalysisAliasingThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
LLVMRemarkTypeFailure
public static final int LLVMRemarkTypeFailureThe type of the emitted remark. (enum LLVMRemarkType)Enum values:
- See Also:
-
-
Method Details
-
nLLVMRemarkStringGetData
public static long nLLVMRemarkStringGetData(long String) Unsafe version of:RemarkStringGetData -
LLVMRemarkStringGetData
Returns the buffer holding the string. -
LLVMRemarkStringGetLen
public static int LLVMRemarkStringGetLen(long String) Returns the size of the string. -
LLVMRemarkDebugLocGetSourceFilePath
public static long LLVMRemarkDebugLocGetSourceFilePath(long DL) Return the path to the source file for a debug location. -
LLVMRemarkDebugLocGetSourceLine
public static int LLVMRemarkDebugLocGetSourceLine(long DL) Return the line in the source file for a debug location. -
LLVMRemarkDebugLocGetSourceColumn
public static int LLVMRemarkDebugLocGetSourceColumn(long DL) Return the column in the source file for a debug location. -
LLVMRemarkArgGetKey
public static long LLVMRemarkArgGetKey(long Arg) Returns the key of an argument. The key defines what the value is, and the same key can appear multiple times in the list of arguments. -
LLVMRemarkArgGetValue
public static long LLVMRemarkArgGetValue(long Arg) Returns the value of an argument. This is a string that can contain newlines. -
LLVMRemarkArgGetDebugLoc
public static long LLVMRemarkArgGetDebugLoc(long Arg) Returns the debug location that is attached to the value of this argument.If there is no debug location, the return value will be
NULL. -
LLVMRemarkEntryDispose
public static void LLVMRemarkEntryDispose(long Remark) Free the resources used by the remark entry. -
LLVMRemarkEntryGetType
public static int LLVMRemarkEntryGetType(long Remark) The type of the remark. For example, it can allow users to only keep the missed optimizations from the compiler. -
LLVMRemarkEntryGetPassName
public static long LLVMRemarkEntryGetPassName(long Remark) Get the name of the pass that emitted this remark. -
LLVMRemarkEntryGetRemarkName
public static long LLVMRemarkEntryGetRemarkName(long Remark) Get an identifier of the remark. -
LLVMRemarkEntryGetFunctionName
public static long LLVMRemarkEntryGetFunctionName(long Remark) Get the name of the function being processed when the remark was emitted. -
LLVMRemarkEntryGetDebugLoc
public static long LLVMRemarkEntryGetDebugLoc(long Remark) Returns the debug location that is attached to this remark.If there is no debug location, the return value will be
NULL. -
LLVMRemarkEntryGetHotness
public static long LLVMRemarkEntryGetHotness(long Remark) Return the hotness of the remark.A hotness of
0means this value is not set. -
LLVMRemarkEntryGetNumArgs
public static int LLVMRemarkEntryGetNumArgs(long Remark) The number of arguments the remark holds. -
LLVMRemarkEntryGetFirstArg
public static long LLVMRemarkEntryGetFirstArg(long Remark) Get a new iterator to iterate over a remark's argument.If there are no arguments in
Remark, the return value will beNULL.The lifetime of the returned value is bound to the lifetime of
Remark. -
LLVMRemarkEntryGetNextArg
public static long LLVMRemarkEntryGetNextArg(long It, long Remark) Get the next argument inRemarkfrom the position ofIt.Returns
NULLif there are no more arguments available.The lifetime of the returned value is bound to the lifetime of
Remark. -
nLLVMRemarkParserCreateYAML
public static long nLLVMRemarkParserCreateYAML(long Buf, long Size) Unsafe version of:RemarkParserCreateYAML -
LLVMRemarkParserCreateYAML
Creates a remark parser that can be used to parse the buffer located inBufof sizeSizebytes.Bufcannot beNULL.This function should be paired with
RemarkParserDisposeto avoid leaking resources. -
nLLVMRemarkParserCreateBitstream
public static long nLLVMRemarkParserCreateBitstream(long Buf, long Size) Unsafe version of:RemarkParserCreateBitstream -
LLVMRemarkParserCreateBitstream
Creates a remark parser that can be used to parse the buffer located inBufof sizeSizebytes.Bufcannot beNULL.This function should be paired with
RemarkParserDisposeto avoid leaking resources.- Since:
- 10
-
LLVMRemarkParserGetNext
public static long LLVMRemarkParserGetNext(long Parser) Returns the next remark in the file.The value pointed to by the return value needs to be disposed using a call to
RemarkEntryDispose.All the entries in the returned value that are of
LLVMRemarkStringReftype will become invalidated once a call toRemarkParserDisposeis made.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:RemarkParserHasErrorwill return1.RemarkParserGetErrorMessagewill return a descriptive error message.
An error may occur if:
- An argument is invalid.
- There is a parsing error. This can occur on things like malformed YAML.
- There is a
Remarksemantic error. This can occur on well-formed files with missing or extra fields.
Here is a quick example of the usage:
LLVMRemarkParserRef Parser = LLVMRemarkParserCreateYAML(Buf, Size); LLVMRemarkEntryRef Remark = NULL; while ((Remark = LLVMRemarkParserGetNext(Parser))) { // use Remark LLVMRemarkEntryDispose(Remark); // Release memory. } bool HasError = LLVMRemarkParserHasError(Parser); LLVMRemarkParserDispose(Parser); -
LLVMRemarkParserHasError
public static boolean LLVMRemarkParserHasError(long Parser) Returns1if the parser encountered an error while parsing the buffer. -
nLLVMRemarkParserGetErrorMessage
public static long nLLVMRemarkParserGetErrorMessage(long Parser) Unsafe version of:RemarkParserGetErrorMessage -
LLVMRemarkParserGetErrorMessage
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. IfRemarkParserDisposeis called, the memory of the string will be released. -
LLVMRemarkParserDispose
public static void LLVMRemarkParserDispose(long Parser) Releases all the resources used byParser. -
LLVMRemarkVersion
public static int LLVMRemarkVersion()Returns the version of the remarks library.
-