diff options
author | Jason Gross <jagro@google.com> | 2018-06-28 15:14:40 -0400 |
---|---|---|
committer | Jason Gross <jasongross9@gmail.com> | 2018-07-03 19:28:55 -0400 |
commit | 71d9873cd3a75b6b7b830ecc15ae179be52c3660 (patch) | |
tree | 013356056f49ec00b008cf3e0a42f0a4bf4dbb68 /src | |
parent | 074dd72defb9df304175adf6e7d167ae7caea7bd (diff) |
static void
Diffstat (limited to 'src')
-rw-r--r-- | src/Experiments/NewPipeline/CStringification.v | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Experiments/NewPipeline/CStringification.v b/src/Experiments/NewPipeline/CStringification.v index 1cf7ee0fc..9d4d55362 100644 --- a/src/Experiments/NewPipeline/CStringification.v +++ b/src/Experiments/NewPipeline/CStringification.v @@ -1827,20 +1827,21 @@ Module Compilers. => fun '(absurd, _) => match absurd : Empty_set with end end%list. - Definition to_function_lines (prefix : string) (name : string) + Definition to_function_lines (static : bool) (prefix : string) (name : string) {t} - (f : type.for_each_lhs_of_arrow var_data t * var_data (type.final_codomain t) * expr) : list string := let '(args, rets, body) := f in - (((("void " + (((((if static then "static " else "") + ++ "void " ++ name ++ "(" ++ (String.concat ", " (to_retarg_list prefix rets ++ to_arg_list_for_each_lhs_of_arrow prefix args)) ++ ") {")%string) :: (List.map (fun s => " " ++ s)%string (to_strings prefix body))) ++ ["}"])%list. - Definition ToFunctionLines (prefix : string) (name : string) + (** TODO: Allow "static" to be configurable? *) + Definition ToFunctionLines (static := true) (prefix : string) (name : string) {t} (e : @Compilers.expr.Expr base.type ident.ident t) (name_list : option (list string)) @@ -1854,7 +1855,7 @@ Module Compilers. ++ [" * Output Bounds:"] ++ List.map (fun v => " * " ++ v)%string (bound_to_string outdata outbounds) ++ [" */"] - ++ to_function_lines prefix name (indata, outdata, f))%list, + ++ to_function_lines static prefix name (indata, outdata, f))%list, collect_infos f) | inr nil => inr ("Unknown internal error in converting " ++ name ++ " to C")%string |