parseIRError: Raise an error from parseIR

Description Usage Arguments Value Author(s) See Also Examples

Description

This is an R-level function for raising an error specifically from parsing an IR file. This is implemented in R and called from C++ code because the messages were calling problems and also because it is easier to raise richer errors, i.e. with classes and extra information.

Usage

1

Arguments

line

the line number in the file where the error occurred

col

the column number in the line where the error occurred

msg

the message describing the error as provided by LLVM

Value

An error object of class ParseIRError and LLVMError.

Author(s)

Duncan Temple Lang

See Also

parseIR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
  ir = c("
         "declare i8* @foo(
    tryCatch(parseIR(paste(ir, collapse = "\n")),
             error = function(e) {
                       print(e$message)
                       print(e$lineNum)
                       print(e$colNum)
                       print(class(e))
                     })

## End(Not run)

doktorschiwago/Rllvm2 documentation built on May 15, 2019, 9:42 a.m.