Class LLVMRemarks


  • public class LLVMRemarks
    extends java.lang.Object
    Requires LLVM 9 or higher.
    • Method Detail

      • nLLVMRemarkStringGetData

        public static long nLLVMRemarkStringGetData​(long String)
        Unsafe version of: RemarkStringGetData
      • LLVMRemarkStringGetData

        @Nullable
        public static java.lang.String LLVMRemarkStringGetData​(long String)
        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 0 means 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 be NULL.

        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 in Remark from the position of It.

        Returns NULL if 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

        public static long LLVMRemarkParserCreateYAML​(java.nio.ByteBuffer Buf)
        Creates a remark parser that can be used to parse the buffer located in Buf of size Size bytes.

        Buf cannot be NULL.

        This function should be paired with RemarkParserDispose to avoid leaking resources.

      • nLLVMRemarkParserCreateBitstream

        public static long nLLVMRemarkParserCreateBitstream​(long Buf,
                                                            long Size)
        Unsafe version of: RemarkParserCreateBitstream
      • LLVMRemarkParserCreateBitstream

        public static long LLVMRemarkParserCreateBitstream​(java.nio.ByteBuffer Buf)
        Creates a remark parser that can be used to parse the buffer located in Buf of size Size bytes.

        Buf cannot be NULL.

        This function should be paired with RemarkParserDispose to 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 LLVMRemarkStringRef type will become invalidated once a call to RemarkParserDispose is 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:

        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 Remark semantic 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)
        Returns 1 if the parser encountered an error while parsing the buffer.
      • nLLVMRemarkParserGetErrorMessage

        public static long nLLVMRemarkParserGetErrorMessage​(long Parser)
        Unsafe version of: RemarkParserGetErrorMessage
      • LLVMRemarkParserGetErrorMessage

        @Nullable
        public static java.lang.String LLVMRemarkParserGetErrorMessage​(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. If RemarkParserDispose is called, the memory of the string will be released.

      • LLVMRemarkParserDispose

        public static void LLVMRemarkParserDispose​(long Parser)
        Releases all the resources used by Parser.
      • LLVMRemarkVersion

        public static int LLVMRemarkVersion()
        Returns the version of the remarks library.