Skip to content

Commit 739243b

Browse files
authored
flambda-backend: Add flambda_oclassic attribute (ocaml#348)
1 parent dc9b7fd commit 739243b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

parsing/builtin_attributes.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,12 @@ let nolabels_attribute attr =
342342
clflags_attribute_without_payload attr
343343
~name:"nolabels" Clflags.classic
344344

345+
let flambda_oclassic_attribute attr =
346+
clflags_attribute_without_payload' attr
347+
~name:"flambda_oclassic"
348+
~f:(fun () ->
349+
if Config.flambda || Config.flambda2 then Clflags.set_oclassic ())
350+
345351
let flambda_o3_attribute attr =
346352
clflags_attribute_without_payload' attr
347353
~name:"flambda_o3"
@@ -378,4 +384,5 @@ let parse_standard_implementation_attributes attr =
378384
nolabels_attribute attr;
379385
inline_attribute attr;
380386
afl_inst_ratio_attribute attr;
381-
flambda_o3_attribute attr
387+
flambda_o3_attribute attr;
388+
flambda_oclassic_attribute attr

parsing/builtin_attributes.mli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- ocaml.inline
3232
- ocaml.afl_inst_ratio
3333
- ocaml.flambda_o3
34+
- ocaml.flambda_oclassic
3435
3536
{b Warning:} this module is unstable and part of
3637
{{!Compiler_libs}compiler-libs}.
@@ -88,4 +89,4 @@ val has_unboxed: Parsetree.attributes -> bool
8889
val has_boxed: Parsetree.attributes -> bool
8990

9091
val parse_standard_interface_attributes : Parsetree.attribute -> unit
91-
val parse_standard_implementation_attributes : Parsetree.attribute -> unit
92+
val parse_standard_implementation_attributes : Parsetree.attribute -> unit

0 commit comments

Comments
 (0)