Data.BitCode.LLVM
A module to produce bitcode from llvm module descriptions.
and calling conv, the call is performed with, and verify
that the symbols type matches the signature; and calling conv
if symbol is a Function Symbol. If Symbol is a reference
ensure that the signature matches. (Data.BitCode.LLVM should
automatically insert the required ptr cast if the symbol does
not match).
Also error if neither a Reference with matching signature nor
a Function. I don't think calling anything else makes any
sense?
This should be computed using `instTy`.
instTy
work for getElementPointer
.instTy
works as expected.mkInstRec
for Call
(e.g. everywhere where we
do not use `instTy` that the type we encode matches the one
we should expect.
And hence can always load the value, but llvm does not work that
way for fwd references. There the value and type are encoded after
each other (ValueId, TypeId). If it's non fwd reference, it's
just ValueId. (see getValueTypePair in BitCodeReader). Similarly this
is required to support fwd references in ToBitCode.
Data.BitCode.LLVM.Util
)
Maybe using `ExceptT` to give good hints as to what faild?
just can not construct invalid code)