From 7fe7859373cc72c4275e3cede4720a99f7acc8a6 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 7 Mar 2018 13:13:30 +0300 Subject: [PATCH] hooks: introduce FUNCTION_CALL_HOOK_BEFORE This is for a test that I'm not ready to push. I used to handle ordering requirements by writing check_debug.h in a specific order but that turns out to be tricky and failure prone. These days I just create new hooks. Signed-off-by: Dan Carpenter --- smatch.h | 1 + smatch_flow.c | 1 + 2 files changed, 2 insertions(+) diff --git a/smatch.h b/smatch.h index 6d27632d..6042ea4f 100644 --- a/smatch.h +++ b/smatch.h @@ -115,6 +115,7 @@ enum hook_type { PRELOOP_HOOK, SELECT_HOOK, WHOLE_CONDITION_HOOK, + FUNCTION_CALL_HOOK_BEFORE, FUNCTION_CALL_HOOK, CALL_HOOK_AFTER_INLINE, FUNCTION_CALL_HOOK_AFTER_DB, diff --git a/smatch_flow.c b/smatch_flow.c index 4dbb47d5..94a1c6b5 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -456,6 +456,7 @@ void __split_expr(struct expression *expr) if (inlinable(expr->fn)) __inline_call = 1; __process_post_op_stack(); + __pass_to_client(expr, FUNCTION_CALL_HOOK_BEFORE); __pass_to_client(expr, FUNCTION_CALL_HOOK); __inline_call = 0; if (inlinable(expr->fn)) { -- 2.11.4.GIT