[sledge] Add printers for some LLVM enums

Reviewed By: kren1

Differential Revision: D15577754

fbshipit-source-id: 8a8f39a87
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent babe25fd29
commit 1e7b13bdcd

@ -34,7 +34,8 @@ let flags exe_or_lib deps =
(ocamlc_flags (%s))
(ocamlopt_flags (%s))
(preprocess
(pps
(staged_pps
ppx_import
ppx_compare
ppx_custom_printf
ppx_deriving_cmdliner

@ -21,6 +21,7 @@ depends: [
"llvm" {= "8.0.0"}
"ppx_compare"
"ppx_deriving_cmdliner" {>= "0.4.2"}
"ppx_import"
"ppx_hash"
"shexp"
"zarith"

@ -15,6 +15,16 @@ let pp_llvalue fs t = Format.pp_print_string fs (Llvm.string_of_llvalue t)
let pp_llblock fs t =
Format.pp_print_string fs (Llvm.string_of_llvalue (Llvm.value_of_block t))
type lllinkage = [%import: Llvm.Linkage.t] [@@deriving sexp]
type llopcode = [%import: Llvm.Opcode.t] [@@deriving sexp]
type llvaluekind = [%import: (Llvm.ValueKind.t[@with Opcode.t := llopcode])]
[@@deriving sexp]
let _pp_lllinkage fs l = Sexp.pp_hum fs (sexp_of_lllinkage l)
let _pp_llopcode fs l = Sexp.pp_hum fs (sexp_of_llopcode l)
let _pp_llvaluekind fs l = Sexp.pp_hum fs (sexp_of_llvaluekind l)
exception Invalid_llvm of string
let invalid_llvm : string -> 'a =

Loading…
Cancel
Save