From 7cfa0a12127396addd81ad433625259162844238 Mon Sep 17 00:00:00 2001 From: Antoniu Pop Date: Fri, 11 Mar 2022 09:35:05 +0000 Subject: [PATCH] feat(dfr): add pre_main and post_main functions to be called when main wrapping is not feasible. --- compiler/lib/Runtime/DFRuntime.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/lib/Runtime/DFRuntime.cpp b/compiler/lib/Runtime/DFRuntime.cpp index 7b6798caf..56c20245a 100644 --- a/compiler/lib/Runtime/DFRuntime.cpp +++ b/compiler/lib/Runtime/DFRuntime.cpp @@ -323,6 +323,16 @@ int __wrap_main(int argc, char *argv[]) { } } +void _dfr_pre_main() { + _dfr_start_impl(0, nullptr); + hpx::suspend(); +} + +void _dfr_post_main() { + hpx::resume(); + _dfr_stop_impl(); +} + /**********************/ /* Debug interface. */ /**********************/