diff options
| author | Alex Richardson | 2020-05-15 13:51:32 +0100 |
|---|---|---|
| committer | Alex Richardson | 2020-05-15 13:52:03 +0100 |
| commit | 402fe1f632f7e6075e0810dcff2d8432b65352d2 (patch) | |
| tree | 044edd4cdd7897c7da1e9ce8ac41facae78ece06 /src | |
| parent | dc5a39649116c7fd76a024d069707f8b3aa7e201 (diff) | |
Add static to registers if -static is passed
This was the final missing step for me to link two almost identical C files
generated from sail into the same library.
Diffstat (limited to 'src')
| -rw-r--r-- | src/jib/c_backend.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jib/c_backend.ml b/src/jib/c_backend.ml index 080be248..40d784ca 100644 --- a/src/jib/c_backend.ml +++ b/src/jib/c_backend.ml @@ -2050,7 +2050,7 @@ let codegen_alloc = function let codegen_def' ctx = function | CDEF_reg_dec (id, ctyp, _) -> string (Printf.sprintf "// register %s" (string_of_id id)) ^^ hardline - ^^ string (Printf.sprintf "%s %s;" (sgen_ctyp ctyp) (sgen_id id)) + ^^ string (Printf.sprintf "%s%s %s;" (if !opt_static then "static " else "") (sgen_ctyp ctyp) (sgen_id id)) | CDEF_spec (id, _, arg_ctyps, ret_ctyp) -> let static = if !opt_static then "static " else "" in |
