LLVM 20.0.0git
|
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 | |
const char * | LLVMRemarkStringGetData (LLVMRemarkStringRef String) |
Returns the buffer holding the string. | |
uint32_t | LLVMRemarkStringGetLen (LLVMRemarkStringRef String) |
Returns the size of the string. | |
LLVMRemarkStringRef | LLVMRemarkDebugLocGetSourceFilePath (LLVMRemarkDebugLocRef DL) |
Return the path to the source file for a debug location. | |
uint32_t | LLVMRemarkDebugLocGetSourceLine (LLVMRemarkDebugLocRef DL) |
Return the line in the source file for a debug location. | |
uint32_t | LLVMRemarkDebugLocGetSourceColumn (LLVMRemarkDebugLocRef DL) |
Return the column in the source file for a debug location. | |
LLVMRemarkStringRef | LLVMRemarkArgGetKey (LLVMRemarkArgRef Arg) |
Returns the key of an argument. | |
LLVMRemarkStringRef | LLVMRemarkArgGetValue (LLVMRemarkArgRef Arg) |
Returns the value of an argument. | |
LLVMRemarkDebugLocRef | LLVMRemarkArgGetDebugLoc (LLVMRemarkArgRef Arg) |
Returns the debug location that is attached to the value of this argument. | |
void | LLVMRemarkEntryDispose (LLVMRemarkEntryRef Remark) |
Free the resources used by the remark entry. | |
enum LLVMRemarkType | LLVMRemarkEntryGetType (LLVMRemarkEntryRef Remark) |
The type of the remark. | |
LLVMRemarkStringRef | LLVMRemarkEntryGetPassName (LLVMRemarkEntryRef Remark) |
Get the name of the pass that emitted this remark. | |
LLVMRemarkStringRef | LLVMRemarkEntryGetRemarkName (LLVMRemarkEntryRef Remark) |
Get an identifier of the remark. | |
LLVMRemarkStringRef | LLVMRemarkEntryGetFunctionName (LLVMRemarkEntryRef Remark) |
Get the name of the function being processed when the remark was emitted. | |
LLVMRemarkDebugLocRef | LLVMRemarkEntryGetDebugLoc (LLVMRemarkEntryRef Remark) |
Returns the debug location that is attached to this remark. | |
uint64_t | LLVMRemarkEntryGetHotness (LLVMRemarkEntryRef Remark) |
Return the hotness of the remark. | |
uint32_t | LLVMRemarkEntryGetNumArgs (LLVMRemarkEntryRef Remark) |
The number of arguments the remark holds. | |
LLVMRemarkArgRef | LLVMRemarkEntryGetFirstArg (LLVMRemarkEntryRef Remark) |
Get a new iterator to iterate over a remark's argument. | |
LLVMRemarkArgRef | LLVMRemarkEntryGetNextArg (LLVMRemarkArgRef It, LLVMRemarkEntryRef Remark) |
Get the next argument in Remark from the position of It . | |
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. | |
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. | |
LLVMRemarkEntryRef | LLVMRemarkParserGetNext (LLVMRemarkParserRef Parser) |
Returns the next remark in the file. | |
LLVMBool | LLVMRemarkParserHasError (LLVMRemarkParserRef Parser) |
Returns 1 if the parser encountered an error while parsing the buffer. | |
const char * | LLVMRemarkParserGetErrorMessage (LLVMRemarkParserRef Parser) |
Returns a null-terminated string containing an error message. | |
void | LLVMRemarkParserDispose (LLVMRemarkParserRef Parser) |
Releases all the resources used by Parser . | |
uint32_t | LLVMRemarkVersion (void) |
Returns the version of the remarks library. | |
typedef struct LLVMRemarkOpaqueArg* LLVMRemarkArgRef |
typedef struct LLVMRemarkOpaqueDebugLoc* LLVMRemarkDebugLocRef |
typedef struct LLVMRemarkOpaqueEntry* LLVMRemarkEntryRef |
typedef struct LLVMRemarkOpaqueParser* LLVMRemarkParserRef |
typedef struct LLVMRemarkOpaqueString* LLVMRemarkStringRef |
enum LLVMRemarkType |
LLVMRemarkDebugLocRef LLVMRemarkArgGetDebugLoc | ( | LLVMRemarkArgRef | 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
.
Definition at line 100 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
LLVMRemarkStringRef LLVMRemarkArgGetKey | ( | LLVMRemarkArgRef | 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.
Definition at line 91 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
LLVMRemarkStringRef LLVMRemarkArgGetValue | ( | LLVMRemarkArgRef | Arg | ) |
Returns the value of an argument.
This is a string that can contain newlines.
Definition at line 95 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
uint32_t LLVMRemarkDebugLocGetSourceColumn | ( | LLVMRemarkDebugLocRef | DL | ) |
Return the column in the source file for a debug location.
Definition at line 87 of file Remark.cpp.
References DL, and llvm::unwrap().
LLVMRemarkStringRef LLVMRemarkDebugLocGetSourceFilePath | ( | LLVMRemarkDebugLocRef | DL | ) |
Return the path to the source file for a debug location.
Definition at line 78 of file Remark.cpp.
References DL, llvm::unwrap(), and llvm::wrap().
uint32_t LLVMRemarkDebugLocGetSourceLine | ( | LLVMRemarkDebugLocRef | DL | ) |
Return the line in the source file for a debug location.
Definition at line 82 of file Remark.cpp.
References DL, and llvm::unwrap().
void LLVMRemarkEntryDispose | ( | LLVMRemarkEntryRef | Remark | ) |
Free the resources used by the remark entry.
Definition at line 106 of file Remark.cpp.
References llvm::unwrap().
LLVMRemarkDebugLocRef LLVMRemarkEntryGetDebugLoc | ( | LLVMRemarkEntryRef | Remark | ) |
Returns the debug location that is attached to this remark.
If there is no debug location, the return value will be NULL
.
Definition at line 131 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
LLVMRemarkArgRef LLVMRemarkEntryGetFirstArg | ( | LLVMRemarkEntryRef | 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
.
Definition at line 148 of file Remark.cpp.
References llvm::unwrap().
LLVMRemarkStringRef LLVMRemarkEntryGetFunctionName | ( | LLVMRemarkEntryRef | Remark | ) |
Get the name of the function being processed when the remark was emitted.
Definition at line 126 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
uint64_t LLVMRemarkEntryGetHotness | ( | LLVMRemarkEntryRef | Remark | ) |
Return the hotness of the remark.
A hotness of 0
means this value is not set.
Definition at line 137 of file Remark.cpp.
References llvm::unwrap().
LLVMRemarkArgRef LLVMRemarkEntryGetNextArg | ( | LLVMRemarkArgRef | It, |
LLVMRemarkEntryRef | 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
.
Definition at line 158 of file Remark.cpp.
References llvm::unwrap().
uint32_t LLVMRemarkEntryGetNumArgs | ( | LLVMRemarkEntryRef | Remark | ) |
The number of arguments the remark holds.
Definition at line 143 of file Remark.cpp.
References llvm::unwrap().
LLVMRemarkStringRef LLVMRemarkEntryGetPassName | ( | LLVMRemarkEntryRef | Remark | ) |
Get the name of the pass that emitted this remark.
Definition at line 116 of file Remark.cpp.
References PassName, llvm::unwrap(), and llvm::wrap().
LLVMRemarkStringRef LLVMRemarkEntryGetRemarkName | ( | LLVMRemarkEntryRef | Remark | ) |
Get an identifier of the remark.
Definition at line 121 of file Remark.cpp.
References llvm::unwrap(), and llvm::wrap().
enum LLVMRemarkType LLVMRemarkEntryGetType | ( | LLVMRemarkEntryRef | Remark | ) |
The type of the remark.
For example, it can allow users to only keep the missed optimizations from the compiler.
Definition at line 110 of file Remark.cpp.
References llvm::unwrap().
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.
Buf
cannot be NULL
.
This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.
Definition at line 136 of file RemarkParser.cpp.
References llvm::remarks::Bitstream, Size, and llvm::wrap().
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.
Buf
cannot be NULL
.
This function should be paired with LLVMRemarkParserDispose() to avoid leaking resources.
Definition at line 130 of file RemarkParser.cpp.
References Size, llvm::wrap(), and llvm::remarks::YAML.
void LLVMRemarkParserDispose | ( | LLVMRemarkParserRef | Parser | ) |
Releases all the resources used by Parser
.
Definition at line 173 of file RemarkParser.cpp.
References llvm::unwrap().
const char * LLVMRemarkParserGetErrorMessage | ( | LLVMRemarkParserRef | 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 LLVMRemarkParserDispose() is called, the memory of the string will be released.
Definition at line 169 of file RemarkParser.cpp.
References llvm::unwrap().
LLVMRemarkEntryRef LLVMRemarkParserGetNext | ( | LLVMRemarkParserRef | Parser | ) |
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:
Definition at line 143 of file RemarkParser.cpp.
References llvm::consumeError(), llvm::Error::isA(), llvm::remarks::RemarkParser::next(), llvm::Expected< T >::takeError(), llvm::unwrap(), and llvm::wrap().
LLVMBool LLVMRemarkParserHasError | ( | LLVMRemarkParserRef | Parser | ) |
Returns 1
if the parser encountered an error while parsing the buffer.
Definition at line 164 of file RemarkParser.cpp.
References llvm::unwrap().
const char * LLVMRemarkStringGetData | ( | LLVMRemarkStringRef | String | ) |
Returns the buffer holding the string.
Definition at line 69 of file Remark.cpp.
References llvm::String, and llvm::unwrap().
uint32_t LLVMRemarkStringGetLen | ( | LLVMRemarkStringRef | String | ) |
Returns the size of the string.
Definition at line 73 of file Remark.cpp.
References llvm::String, and llvm::unwrap().
uint32_t LLVMRemarkVersion | ( | void | ) |
Returns the version of the remarks library.