Skip to content

config support in isla-sail #93

Description

@cfbolz

I was wondering whether support for the new json config values (without giving the configuration at build time) is planned, or whether people are interested in it. For Pydrofoil it would be rather useful to have.

for my local use I've added a patch like this, should I maybe open a PR?

diff --git a/isla-sail/jib_ir.ml b/isla-sail/jib_ir.ml
index 9d904b3..63dc6b7 100644
--- a/isla-sail/jib_ir.ml
+++ b/isla-sail/jib_ir.ml
@@ -157,6 +157,8 @@ module Ir_formatter = struct
          add_instr n buf indent (string_of_name id ^ " : " ^ C.typ ctyp ^ output_loc l)
       | I_init (ctyp, id, Init_cval cval) | I_reinit (ctyp, id, cval) ->
          add_instr n buf indent (string_of_name id ^ " : " ^ C.typ ctyp ^ " = " ^ C.value cval ^ output_loc l)
+      | I_init (ctyp, id, Init_json_key parts) ->
+         add_instr n buf indent (string_of_name id ^ " : " ^ C.typ ctyp ^ " = $json_key(" ^ (Util.string_of_list ", " (fun part -> "\"" ^ part ^ "\"") parts) ^ ")" ^ output_loc l)
       | I_clear (ctyp, id) ->
          add_instr n buf indent ("!" ^ string_of_name id)
       | I_label label ->
diff --git a/isla-sail/sail_plugin_isla.ml b/isla-sail/sail_plugin_isla.ml
index 3ba6260..a73ad19 100644
--- a/isla-sail/sail_plugin_isla.ml
+++ b/isla-sail/sail_plugin_isla.ml
@@ -367,4 +367,5 @@ let _ =
     ~options:isla_options
     ~pre_parse_hook:isla_initialize
     ~rewrites:isla_rewrites
+    ~supports_runtime_config:true
     isla_target

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions