|
|
|
|
|
|
| Synopsis |
|
|
|
|
| Main data type
|
|
|
So-called Literals are one of:
- An unboxed (machine) literal (MachInt, MachFloat, etc.),
which is presumed to be surrounded by appropriate constructors
(Int#, etc.), so that the overall thing makes sense.
- The literal derived from the label mentioned in a "foreign label"
declaration (MachLabel)
| | Constructors | | MachChar Char | Char# - at least 31 bits. Create with mkMachChar
| | MachStr FastString | A string-literal: stored and emitted
UTF-8 encoded, we'll arrange to decode it
at runtime. Also emitted with a '\0'
terminator. Create with mkMachString
| | MachNullAddr | The NULL pointer, the only pointer value
that can be represented as a Literal. Create
with nullAddrLit
| | MachInt Integer | Int# - at least WORD_SIZE_IN_BITS bits. Create with mkMachInt
| | MachInt64 Integer | Int64# - at least 64 bits. Create with mkMachInt64
| | MachWord Integer | Word# - at least WORD_SIZE_IN_BITS bits. Create with mkMachWord
| | MachWord64 Integer | Word64# - at least 64 bits. Create with mkMachWord64
| | MachFloat Rational | Float#. Create with mkMachFloat
| | MachDouble Rational | Double#. Create with mkMachDouble
| | MachLabel FastString (Maybe Int) FunctionOrData | A label literal. Parameters:
1) The name of the symbol mentioned in the declaration
2) The size (in bytes) of the arguments
the label expects. Only applicable with
stdcall labels. Just x => <x> will
be appended to label name when emitting assembly.
|
| Instances | |
|
|
| Creating Literals
|
|
|
| Creates a Literal of type Int#
|
|
|
| Creates a Literal of type Word#
|
|
|
| Creates a Literal of type Int64#
|
|
|
| Creates a Literal of type Word64#
|
|
|
| Creates a Literal of type Float#
|
|
|
| Creates a Literal of type Double#
|
|
|
| Creates a Literal of type Char#
|
|
|
| Creates a Literal of type Addr#, which is appropriate for passing to
e.g. some of the "error" functions in GHC.Err such as GHC.Err.runtimeError
|
|
| Operations on Literals
|
|
|
| Find the Haskell Type the literal occupies
|
|
|
|
| Predicates on Literals and their contents
|
|
|
| True if code space does not go bad if we duplicate this literal
Currently we treat it just like litIsTrivial
|
|
|
| True if there is absolutely no penalty to duplicating the literal.
False principally of strings
|
|
|
|
|
|
|
|
|
|
|
| Tests whether the literal represents a zero of whatever type it is
|
|
|
|
| Coercions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Produced by Haddock version 2.6.1 |