From 0f210f622a4609811959f4450f770c61f5eb6532 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 22 Sep 2017 15:01:34 +0200 Subject: Disallow usage of default pattern for AsmToJSON. In order to ensure that no new instruction is added without adding it to the Json export we enforce warning 4 for the instruction printer and removed all default pattern matchings. Bug 22239 --- powerpc/AsmToJSON.ml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'powerpc/AsmToJSON.ml') diff --git a/powerpc/AsmToJSON.ml b/powerpc/AsmToJSON.ml index e84746a8..2017d3e3 100644 --- a/powerpc/AsmToJSON.ml +++ b/powerpc/AsmToJSON.ml @@ -128,7 +128,7 @@ let pp_instructions pp ic = pp_jmember ~first:true pp "Instruction Name" pp_jstring n; pp_jmember pp "Args" (pp_jarray pp_arg) args; pp_jobject_end pp in - let instruction pp = function + let [@ocaml.warning "+4"] instruction pp = function | Padd (ir1,ir2,ir3) | Padd64 (ir1,ir2,ir3) -> instruction pp "Padd" [Ireg ir1; Ireg ir2; Ireg ir3] | Paddc (ir1,ir2,ir3) -> instruction pp "Paddc" [Ireg ir1; Ireg ir2; Ireg ir3] @@ -353,7 +353,16 @@ let pp_instructions pp ic = Buffer.add_char buf c) annot_string; let annot_string = Buffer.contents buf in instruction pp "Pannot" [String annot_string] - | _ -> assert false + | EF_annot_val _ + | EF_builtin _ + | EF_debug _ + | EF_external _ + | EF_free + | EF_malloc + | EF_memcpy _ + | EF_runtime _ + | EF_vload _ + | EF_vstore _ -> assert false end | Pcfi_adjust _ (* Only debug relevant *) | Pcfi_rel_offset _ -> assert false in (* Only debug relevant *) -- cgit