Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.LLVM.BitCode
Synopsis
- parseBitCode :: ByteString -> IO (Either Error Module)
- parseBitCodeFromFile :: FilePath -> IO (Either Error Module)
- parseBitCodeLazy :: ByteString -> IO (Either Error Module)
- parseBitCodeLazyFromFile :: FilePath -> IO (Either Error Module)
- parseBitCodeWithWarnings :: ByteString -> IO (Either Error (Module, Seq ParseWarning))
- parseBitCodeFromFileWithWarnings :: FilePath -> IO (Either Error (Module, Seq ParseWarning))
- parseBitCodeLazyWithWarnings :: ByteString -> IO (Either Error (Module, Seq ParseWarning))
- parseBitCodeLazyFromFileWithWarnings :: FilePath -> IO (Either Error (Module, Seq ParseWarning))
- data Error = Error {
- errContext :: [String]
- errMessage :: String
- formatError :: Error -> String
- data ParseWarning = InvalidMetadataRecordSize !Int !MetadataRecordSizeRange ![String]
- data MetadataRecordSizeRange
- ppParseWarnings :: Seq ParseWarning -> Doc
- ppParseWarning :: ParseWarning -> Doc
Bitcode Parsing
Without ParseWarning
s
parseBitCode :: ByteString -> IO (Either Error Module) Source #
Deprecated: Use parseBitCodeWithWarnings instead.
Parse the contents of an LLVM bitcode file as a strict ByteString
. If
parsing succeeds, return the parsed Module
. Otherwise, return an Error
describing what went wrong.
See also parseBitCodeWithWarnings
for a version that also returns any
warnings that arise during parsing. This function will simply discard all
such warnings, which is why this function is deprecated.
parseBitCodeFromFile :: FilePath -> IO (Either Error Module) Source #
Deprecated: Use parseBitCodeFromFileWithWarnings instead.
Load an LLVM bitcode file as a strict ByteString
and parse its
contents. If parsing succeeds, return the parsed Module
. Otherwise, return
an Error
describing what went wrong.
See also parseBitCodeFromFileWithWarnings
for a version that also returns
any warnings that arise during parsing. This function will simply discard all
such warnings, which is why this function is deprecated.
parseBitCodeLazy :: ByteString -> IO (Either Error Module) Source #
Deprecated: Use parseBitCodeLazyWithWarnings instead.
Parse the contents of an LLVM bitcode file as a lazy ByteString
. If
parsing succeeds, return the parsed Module
. Otherwise, return an Error
describing what went wrong.
See also parseBitCodeLazyWithWarnings
for a version that also returns any
warnings that arise during parsing. This function will simply discard all
such warnings, which is why this function is deprecated.
parseBitCodeLazyFromFile :: FilePath -> IO (Either Error Module) Source #
Deprecated: Use parseBitCodeLazyFromFileWithWarnings instead.
Load an LLVM bitcode file as a lazy ByteString
and parse its contents.
If parsing succeeds, return the parsed Module
. Otherwise, return an Error
describing what went wrong in a Left
value.
See also parseBitCodeLazyFromFileWithWarnings
for a version that also
returns any warnings that arise during parsing. This function will simply
discard all such warnings, which is why this function is deprecated.
With ParseWarning
s
parseBitCodeWithWarnings :: ByteString -> IO (Either Error (Module, Seq ParseWarning)) Source #
Parse the contents of an LLVM bitcode file as a strict ByteString
. If
parsing succeeds, return the parsed Module
and any ParseWarning
s that
were emitted. Otherwise, return an Error
describing what went wrong.
See also parseBitCode
for a version that discards any warnings that arise
during parsing.
parseBitCodeFromFileWithWarnings :: FilePath -> IO (Either Error (Module, Seq ParseWarning)) Source #
Load an LLVM bitcode file as a strict ByteString
and parse its
contents. If parsing succeeds, return the parsed Module
and any
ParseWarnings
that were emitted. Otherwise, return an Error
describing
what went wrong.
See also parseBitCodeFromFile
for a version that discards any warnings that
arise during parsing.
parseBitCodeLazyWithWarnings :: ByteString -> IO (Either Error (Module, Seq ParseWarning)) Source #
Parse the contents of an LLVM bitcode file as a lazy ByteString
. If
parsing succeeds, return the parsed Module
and any ParseWarning
s that
were emitted. Otherwise, return an Error
describing what went wrong.
See also parseBitCodeLazy
for a version that discards any warnings that
arise during parsing.
parseBitCodeLazyFromFileWithWarnings :: FilePath -> IO (Either Error (Module, Seq ParseWarning)) Source #
Load an LLVM bitcode file as a lazy ByteString
and parse its contents.
If parsing succeeds, return the parsed Module
and any ParseWarnings
that
were emitted. Otherwise, return an Error
describing what went wrong.
See also parseBitCodeLazyFromFile
for a version that discards any warnings
that arise during parsing.
Re-exported
Constructors
Error | |
Fields
|
formatError :: Error -> String Source #
data ParseWarning Source #
Warnings about non-fatal issues that arise during parsing.
Constructors
InvalidMetadataRecordSize !Int !MetadataRecordSizeRange ![String] | The parser encountered a metadata record with an unexpected size.
The |
Instances
Show ParseWarning Source # | |
Defined in Data.LLVM.BitCode.Parse Methods showsPrec :: Int -> ParseWarning -> ShowS # show :: ParseWarning -> String # showList :: [ParseWarning] -> ShowS # |
data MetadataRecordSizeRange Source #
The expected size of a metadata record.
Constructors
MetadataRecordSizeBetween !Int !Int | The size is expected between a lower bound (the first |
MetadataRecordSizeIn ![Int] | The size is expected to be within a certain list of possible values. |
MetadataRecordSizeAtLeast !Int |
Instances
Show MetadataRecordSizeRange Source # | |
Defined in Data.LLVM.BitCode.Parse Methods showsPrec :: Int -> MetadataRecordSizeRange -> ShowS # show :: MetadataRecordSizeRange -> String # showList :: [MetadataRecordSizeRange] -> ShowS # |
ppParseWarnings :: Seq ParseWarning -> Doc Source #
Pretty-print a group of ParseWarning
s in a format suitable for
user-facing messages.
ppParseWarning :: ParseWarning -> Doc Source #
Pretty-print a single ParseWarning
in a format suitable for user-facing
messages. (See also ppParseWarnings
, which pretty-prints several
ParseWarnings
s in a cohesive way.)