From 35db979d7e723ba2ac5bef4629a15b4919d937d4 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 8 Dec 2017 16:24:49 +0100 Subject: Introduce and use C2C.atom_inline function with 3-valued result Instead of two Boolean tests C2C.atom_is_{no,}inline, have a single C2C.atom_inline function that returns one of the three possible values stored in the the a_inline field. --- backend/Inliningaux.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'backend/Inliningaux.ml') diff --git a/backend/Inliningaux.ml b/backend/Inliningaux.ml index 42f58247..842e0c93 100644 --- a/backend/Inliningaux.ml +++ b/backend/Inliningaux.ml @@ -86,7 +86,10 @@ let static_called_once id io = (* To be considered: heuristics based on size of function? *) let should_inline (io: inlining_info) (id: ident) (f: coq_function) = - if !Clflags.option_finline && not (C2C.atom_is_noinline id) then - C2C.atom_is_inline id || static_called_once id io - else + if !Clflags.option_finline then begin + match C2C.atom_inline id with + | C2C.Inline -> true + | C2C.Noinline -> false + | C2C.No_specifier -> static_called_once id io + end else false -- cgit