LLVM
8.0.1
|
Classes | |
struct | LLVMOptRemarkStringRef |
String containing a buffer and a length. More... | |
struct | LLVMOptRemarkDebugLoc |
DebugLoc containing File, Line and Column. More... | |
struct | LLVMOptRemarkArg |
Element of the "Args" list. More... | |
struct | LLVMOptRemarkEntry |
One remark entry. More... | |
Macros | |
#define | OPT_REMARKS_API_VERSION 0 |
Typedefs | |
typedef struct LLVMOptRemarkOpaqueParser * | LLVMOptRemarkParserRef |
Functions | |
LLVMOptRemarkParserRef | LLVMOptRemarkParserCreate (const void *Buf, uint64_t Size) |
Creates a remark parser that can be used to read and parse the buffer located in Buf of size Size . More... | |
LLVMOptRemarkEntry * | LLVMOptRemarkParserGetNext (LLVMOptRemarkParserRef Parser) |
Returns the next remark in the file. More... | |
LLVMBool | LLVMOptRemarkParserHasError (LLVMOptRemarkParserRef Parser) |
Returns 1 if the parser encountered an error while parsing the buffer. More... | |
const char * | LLVMOptRemarkParserGetErrorMessage (LLVMOptRemarkParserRef Parser) |
Returns a null-terminated string containing an error message. More... | |
void | LLVMOptRemarkParserDispose (LLVMOptRemarkParserRef Parser) |
Releases all the resources used by Parser . More... | |
uint32_t | LLVMOptRemarkVersion (void) |
Returns the version of the opt-remarks dylib. More... | |
#define OPT_REMARKS_API_VERSION 0 |
Definition at line 34 of file OptRemarks.h.
typedef struct LLVMOptRemarkOpaqueParser* LLVMOptRemarkParserRef |
Definition at line 102 of file OptRemarks.h.
LLVMOptRemarkParserRef LLVMOptRemarkParserCreate | ( | const void * | Buf, |
uint64_t | Size | ||
) |
Creates a remark parser that can be used to read and parse the buffer located in Buf
of size Size
.
Buf
cannot be NULL.
This function should be paired with LLVMOptRemarkParserDispose() to avoid leaking resources.
Definition at line 325 of file OptRemarksParser.cpp.
References llvm::wrap().
void LLVMOptRemarkParserDispose | ( | LLVMOptRemarkParserRef | Parser | ) |
Releases all the resources used by Parser
.
Definition at line 366 of file OptRemarksParser.cpp.
References llvm::unwrap().
const char* LLVMOptRemarkParserGetErrorMessage | ( | LLVMOptRemarkParserRef | 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 LLVMOptRemarkParserDispose() is called, the memory of the string will be released.
Definition at line 362 of file OptRemarksParser.cpp.
References llvm::unwrap().
LLVMOptRemarkEntry* LLVMOptRemarkParserGetNext | ( | LLVMOptRemarkParserRef | Parser | ) |
Returns the next remark in the file.
The value pointed to by the return value is invalidated by the next call to LLVMOptRemarkParserGetNext().
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) LLVMOptRemarkParserHasError() will return 1
.
2) LLVMOptRemarkParserGetErrorMessage() will return a descriptive error message.
An error may occur if:
1) An argument is invalid.
2) There is a YAML parsing error. This type of error aborts parsing immediately and returns 1
. It can occur on malformed YAML.
3) 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:
Definition at line 332 of file OptRemarksParser.cpp.
References E, llvm::handleAllErrors(), and llvm::unwrap().
LLVMBool LLVMOptRemarkParserHasError | ( | LLVMOptRemarkParserRef | Parser | ) |
Returns 1
if the parser encountered an error while parsing the buffer.
Definition at line 357 of file OptRemarksParser.cpp.
References llvm::unwrap().
uint32_t LLVMOptRemarkVersion | ( | void | ) |
Returns the version of the opt-remarks dylib.