LLVM 22.0.0git
Collaboration diagram for Remarks:

Macros

#define REMARKS_API_VERSION   1

Typedefs

typedef struct LLVMRemarkOpaqueString * LLVMRemarkStringRef
 String containing a buffer and a length.
typedef struct LLVMRemarkOpaqueDebugLoc * LLVMRemarkDebugLocRef
 DebugLoc containing File, Line and Column.
typedef struct LLVMRemarkOpaqueArg * LLVMRemarkArgRef
 Element of the "Args" list.
typedef struct LLVMRemarkOpaqueEntry * LLVMRemarkEntryRef
 A remark emitted by the compiler.
typedef struct LLVMRemarkOpaqueParser * LLVMRemarkParserRef

Enumerations

enum  LLVMRemarkType {
  LLVMRemarkTypeUnknown , LLVMRemarkTypePassed , LLVMRemarkTypeMissed , LLVMRemarkTypeAnalysis ,
  LLVMRemarkTypeAnalysisFPCommute , LLVMRemarkTypeAnalysisAliasing , LLVMRemarkTypeFailure
}
 The type of the emitted remark. More...

Functions

LLVM_C_ABI const charLLVMRemarkStringGetData (LLVMRemarkStringRef String)
 Returns the buffer holding the string.
LLVM_C_ABI uint32_t LLVMRemarkStringGetLen (LLVMRemarkStringRef String)
 Returns the size of the string.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkDebugLocGetSourceFilePath (LLVMRemarkDebugLocRef DL)
 Return the path to the source file for a debug location.
LLVM_C_ABI uint32_t LLVMRemarkDebugLocGetSourceLine (LLVMRemarkDebugLocRef DL)
 Return the line in the source file for a debug location.
LLVM_C_ABI uint32_t LLVMRemarkDebugLocGetSourceColumn (LLVMRemarkDebugLocRef DL)
 Return the column in the source file for a debug location.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkArgGetKey (LLVMRemarkArgRef Arg)
 Returns the key of an argument.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkArgGetValue (LLVMRemarkArgRef Arg)
 Returns the value of an argument.
LLVM_C_ABI LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc (LLVMRemarkArgRef Arg)
 Returns the debug location that is attached to the value of this argument.
LLVM_C_ABI void LLVMRemarkEntryDispose (LLVMRemarkEntryRef Remark)
 Free the resources used by the remark entry.
LLVM_C_ABI enum LLVMRemarkType LLVMRemarkEntryGetType (LLVMRemarkEntryRef Remark)
 The type of the remark.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetPassName (LLVMRemarkEntryRef Remark)
 Get the name of the pass that emitted this remark.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetRemarkName (LLVMRemarkEntryRef Remark)
 Get an identifier of the remark.
LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetFunctionName (LLVMRemarkEntryRef Remark)
 Get the name of the function being processed when the remark was emitted.
LLVM_C_ABI LLVMRemarkDebugLocRef LLVMRemarkEntryGetDebugLoc (LLVMRemarkEntryRef Remark)
 Returns the debug location that is attached to this remark.
LLVM_C_ABI uint64_t LLVMRemarkEntryGetHotness (LLVMRemarkEntryRef Remark)
 Return the hotness of the remark.
LLVM_C_ABI uint32_t LLVMRemarkEntryGetNumArgs (LLVMRemarkEntryRef Remark)
 The number of arguments the remark holds.
LLVM_C_ABI LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg (LLVMRemarkEntryRef Remark)
 Get a new iterator to iterate over a remark's argument.
LLVM_C_ABI LLVMRemarkArgRef LLVMRemarkEntryGetNextArg (LLVMRemarkArgRef It, LLVMRemarkEntryRef Remark)
 Get the next argument in Remark from the position of It.
LLVM_C_ABI LLVMRemarkParserRef LLVMRemarkParserCreateYAML (const void *Buf, uint64_t Size)
 Creates a remark parser that can be used to parse the buffer located in Buf of size Size bytes.
LLVM_C_ABI LLVMRemarkParserRef LLVMRemarkParserCreateBitstream (const void *Buf, uint64_t Size)
 Creates a remark parser that can be used to parse the buffer located in Buf of size Size bytes.
LLVM_C_ABI LLVMRemarkEntryRef LLVMRemarkParserGetNext (LLVMRemarkParserRef Parser)
 Returns the next remark in the file.
LLVM_C_ABI LLVMBool LLVMRemarkParserHasError (LLVMRemarkParserRef Parser)
 Returns 1 if the parser encountered an error while parsing the buffer.
LLVM_C_ABI const charLLVMRemarkParserGetErrorMessage (LLVMRemarkParserRef Parser)
 Returns a null-terminated string containing an error message.
LLVM_C_ABI void LLVMRemarkParserDispose (LLVMRemarkParserRef Parser)
 Releases all the resources used by Parser.
uint32_t LLVMRemarkVersion (void)
 Returns the version of the remarks library.

Detailed Description

Macro Definition Documentation

◆ REMARKS_API_VERSION

#define REMARKS_API_VERSION   1

Definition at line 37 of file Remarks.h.

Typedef Documentation

◆ LLVMRemarkArgRef

typedef struct LLVMRemarkOpaqueArg* LLVMRemarkArgRef

Element of the "Args" list.

The key might give more information about what the semantics of the value are, e.g. "Callee" will tell you that the value is a symbol that names a function.

Since
REMARKS_API_VERSION=0

Definition at line 113 of file Remarks.h.

◆ LLVMRemarkDebugLocRef

typedef struct LLVMRemarkOpaqueDebugLoc* LLVMRemarkDebugLocRef

DebugLoc containing File, Line and Column.

Since
REMARKS_API_VERSION=0

Definition at line 80 of file Remarks.h.

◆ LLVMRemarkEntryRef

typedef struct LLVMRemarkOpaqueEntry* LLVMRemarkEntryRef

A remark emitted by the compiler.

Since
REMARKS_API_VERSION=0

Definition at line 146 of file Remarks.h.

◆ LLVMRemarkParserRef

typedef struct LLVMRemarkOpaqueParser* LLVMRemarkParserRef

Definition at line 238 of file Remarks.h.

◆ LLVMRemarkStringRef

typedef struct LLVMRemarkOpaqueString* LLVMRemarkStringRef

String containing a buffer and a length.

The buffer is not guaranteed to be zero-terminated.

Since
REMARKS_API_VERSION=0

Definition at line 58 of file Remarks.h.

Enumeration Type Documentation

◆ LLVMRemarkType

The type of the emitted remark.

Enumerator
LLVMRemarkTypeUnknown 
LLVMRemarkTypePassed 
LLVMRemarkTypeMissed 
LLVMRemarkTypeAnalysis 
LLVMRemarkTypeAnalysisFPCommute 
LLVMRemarkTypeAnalysisAliasing 
LLVMRemarkTypeFailure 

Definition at line 42 of file Remarks.h.

Function Documentation

◆ LLVMRemarkArgGetDebugLoc()

LLVM_C_ABI LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc ( LLVMRemarkArgRef Arg)
extern

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.

Since
REMARKS_API_VERSION=0

Definition at line 100 of file Remark.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkArgGetKey()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkArgGetKey ( LLVMRemarkArgRef Arg)
extern

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.

Since
REMARKS_API_VERSION=0

Definition at line 91 of file Remark.cpp.

References llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkArgGetValue()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkArgGetValue ( LLVMRemarkArgRef Arg)
extern

Returns the value of an argument.

This is a string that can contain newlines.

Since
REMARKS_API_VERSION=0

Definition at line 95 of file Remark.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkDebugLocGetSourceColumn()

LLVM_C_ABI uint32_t LLVMRemarkDebugLocGetSourceColumn ( LLVMRemarkDebugLocRef DL)
extern

Return the column in the source file for a debug location.

Since
REMARKS_API_VERSION=0

Definition at line 87 of file Remark.cpp.

References DL, and llvm::unwrap().

◆ LLVMRemarkDebugLocGetSourceFilePath()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkDebugLocGetSourceFilePath ( LLVMRemarkDebugLocRef DL)
extern

Return the path to the source file for a debug location.

Since
REMARKS_API_VERSION=0

Definition at line 78 of file Remark.cpp.

References DL, llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkDebugLocGetSourceLine()

LLVM_C_ABI uint32_t LLVMRemarkDebugLocGetSourceLine ( LLVMRemarkDebugLocRef DL)
extern

Return the line in the source file for a debug location.

Since
REMARKS_API_VERSION=0

Definition at line 82 of file Remark.cpp.

References DL, and llvm::unwrap().

◆ LLVMRemarkEntryDispose()

LLVM_C_ABI void LLVMRemarkEntryDispose ( LLVMRemarkEntryRef Remark)
extern

Free the resources used by the remark entry.

Since
REMARKS_API_VERSION=0

Definition at line 106 of file Remark.cpp.

References llvm::unwrap().

◆ LLVMRemarkEntryGetDebugLoc()

LLVM_C_ABI LLVMRemarkDebugLocRef LLVMRemarkEntryGetDebugLoc ( LLVMRemarkEntryRef Remark)
extern

Returns the debug location that is attached to this remark.

If there is no debug location, the return value will be NULL.

Since
REMARKS_API_VERSION=0

Definition at line 131 of file Remark.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkEntryGetFirstArg()

LLVM_C_ABI LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg ( LLVMRemarkEntryRef Remark)
extern

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.

Since
REMARKS_API_VERSION=0

Definition at line 148 of file Remark.cpp.

References llvm::unwrap().

◆ LLVMRemarkEntryGetFunctionName()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetFunctionName ( LLVMRemarkEntryRef Remark)
extern

Get the name of the function being processed when the remark was emitted.

Since
REMARKS_API_VERSION=0

Definition at line 126 of file Remark.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkEntryGetHotness()

LLVM_C_ABI uint64_t LLVMRemarkEntryGetHotness ( LLVMRemarkEntryRef Remark)
extern

Return the hotness of the remark.

A hotness of 0 means this value is not set.

Since
REMARKS_API_VERSION=0

Definition at line 137 of file Remark.cpp.

References llvm::unwrap().

◆ LLVMRemarkEntryGetNextArg()

LLVM_C_ABI LLVMRemarkArgRef LLVMRemarkEntryGetNextArg ( LLVMRemarkArgRef It,
LLVMRemarkEntryRef Remark )
extern

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.

Since
REMARKS_API_VERSION=0

Definition at line 158 of file Remark.cpp.

References llvm::Next, and llvm::unwrap().

◆ LLVMRemarkEntryGetNumArgs()

LLVM_C_ABI uint32_t LLVMRemarkEntryGetNumArgs ( LLVMRemarkEntryRef Remark)
extern

The number of arguments the remark holds.

Since
REMARKS_API_VERSION=0

Definition at line 143 of file Remark.cpp.

References llvm::unwrap().

◆ LLVMRemarkEntryGetPassName()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetPassName ( LLVMRemarkEntryRef Remark)
extern

Get the name of the pass that emitted this remark.

Since
REMARKS_API_VERSION=0

Definition at line 116 of file Remark.cpp.

References PassName, llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkEntryGetRemarkName()

LLVM_C_ABI LLVMRemarkStringRef LLVMRemarkEntryGetRemarkName ( LLVMRemarkEntryRef Remark)
extern

Get an identifier of the remark.

Since
REMARKS_API_VERSION=0

Definition at line 121 of file Remark.cpp.

References llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkEntryGetType()

LLVM_C_ABI enum LLVMRemarkType LLVMRemarkEntryGetType ( LLVMRemarkEntryRef Remark)
extern

The type of the remark.

For example, it can allow users to only keep the missed optimizations from the compiler.

Since
REMARKS_API_VERSION=0

Definition at line 110 of file Remark.cpp.

References llvm::unwrap().

◆ LLVMRemarkParserCreateBitstream()

LLVM_C_ABI LLVMRemarkParserRef LLVMRemarkParserCreateBitstream ( const void * Buf,
uint64_t Size )
extern

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 LLVMRemarkParserDispose() to avoid leaking resources.

Since
REMARKS_API_VERSION=1

Definition at line 115 of file RemarkParser.cpp.

References llvm::remarks::Bitstream, Size, and llvm::wrap().

◆ LLVMRemarkParserCreateYAML()

LLVM_C_ABI LLVMRemarkParserRef LLVMRemarkParserCreateYAML ( const void * Buf,
uint64_t Size )
extern

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 LLVMRemarkParserDispose() to avoid leaking resources.

Since
REMARKS_API_VERSION=0

Definition at line 109 of file RemarkParser.cpp.

References const, LLVMRemarkParserCreateYAML(), Size, llvm::wrap(), and llvm::remarks::YAML.

Referenced by LLVMRemarkParserCreateYAML().

◆ LLVMRemarkParserDispose()

LLVM_C_ABI void LLVMRemarkParserDispose ( LLVMRemarkParserRef Parser)
extern

Releases all the resources used by Parser.

Since
REMARKS_API_VERSION=0

Definition at line 152 of file RemarkParser.cpp.

References llvm::unwrap().

◆ LLVMRemarkParserGetErrorMessage()

LLVM_C_ABI const char * LLVMRemarkParserGetErrorMessage ( LLVMRemarkParserRef Parser)
extern

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 LLVMRemarkParserDispose() is called, the memory of the string will be released.

Since
REMARKS_API_VERSION=0

Definition at line 148 of file RemarkParser.cpp.

References llvm::unwrap().

◆ LLVMRemarkParserGetNext()

LLVM_C_ABI LLVMRemarkEntryRef LLVMRemarkParserGetNext ( LLVMRemarkParserRef Parser)
extern

Returns the next remark in the file.

The value pointed to by the return value needs to be disposed using a call to LLVMRemarkEntryDispose().

All the entries in the returned value that are of LLVMRemarkStringRef type will become invalidated once a call to LLVMRemarkParserDispose 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:

1) LLVMRemarkParserHasError() will return 1.

2) LLVMRemarkParserGetErrorMessage() will return a descriptive error message.

An error may occur if:

1) An argument is invalid.

2) There is a parsing error. This can occur on things like malformed YAML.

3) 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:

LLVMRemarkEntryRef Remark = NULL;
while ((Remark = LLVMRemarkParserGetNext(Parser))) {
// use Remark
LLVMRemarkEntryDispose(Remark); // Release memory.
}
bool HasError = LLVMRemarkParserHasError(Parser);
LLVM_C_ABI LLVMRemarkEntryRef LLVMRemarkParserGetNext(LLVMRemarkParserRef Parser)
Returns the next remark in the file.
struct LLVMRemarkOpaqueEntry * LLVMRemarkEntryRef
A remark emitted by the compiler.
Definition Remarks.h:146
LLVM_C_ABI void LLVMRemarkParserDispose(LLVMRemarkParserRef Parser)
Releases all the resources used by Parser.
LLVM_C_ABI LLVMRemarkParserRef LLVMRemarkParserCreateYAML(const void *Buf, uint64_t Size)
Creates a remark parser that can be used to parse the buffer located in Buf of size Size bytes.
struct LLVMRemarkOpaqueParser * LLVMRemarkParserRef
Definition Remarks.h:238
LLVM_C_ABI void LLVMRemarkEntryDispose(LLVMRemarkEntryRef Remark)
Free the resources used by the remark entry.
Definition Remark.cpp:106
LLVM_C_ABI LLVMBool LLVMRemarkParserHasError(LLVMRemarkParserRef Parser)
Returns 1 if the parser encountered an error while parsing the buffer.
Since
REMARKS_API_VERSION=0

Definition at line 122 of file RemarkParser.cpp.

References llvm::consumeError(), E(), llvm::remarks::RemarkParser::next(), llvm::Expected< T >::takeError(), llvm::unwrap(), and llvm::wrap().

◆ LLVMRemarkParserHasError()

LLVM_C_ABI LLVMBool LLVMRemarkParserHasError ( LLVMRemarkParserRef Parser)
extern

Returns 1 if the parser encountered an error while parsing the buffer.

Since
REMARKS_API_VERSION=0

Definition at line 143 of file RemarkParser.cpp.

References llvm::unwrap().

◆ LLVMRemarkStringGetData()

LLVM_C_ABI const char * LLVMRemarkStringGetData ( LLVMRemarkStringRef String)
extern

Returns the buffer holding the string.

Since
REMARKS_API_VERSION=0

Definition at line 69 of file Remark.cpp.

References const, LLVMRemarkStringGetData(), llvm::String, and llvm::unwrap().

Referenced by LLVMRemarkStringGetData().

◆ LLVMRemarkStringGetLen()

LLVM_C_ABI uint32_t LLVMRemarkStringGetLen ( LLVMRemarkStringRef String)
extern

Returns the size of the string.

Since
REMARKS_API_VERSION=0

Definition at line 73 of file Remark.cpp.

References llvm::String, and llvm::unwrap().

◆ LLVMRemarkVersion()

uint32_t LLVMRemarkVersion ( void )
extern

Returns the version of the remarks library.

Since
REMARKS_API_VERSION=0

References LLVM_C_EXTERN_C_END.