From 34629475e81902b127aa8da1b3fe45e431526d1f Mon Sep 17 00:00:00 2001 From: Pavel Durov Date: Mon, 25 Nov 2024 19:05:12 +0000 Subject: [PATCH] Add clarification comment. --- llvm/lib/Transforms/Yk/ModuleClone.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Yk/ModuleClone.cpp b/llvm/lib/Transforms/Yk/ModuleClone.cpp index 765091f18b0bd06..d3ccdeb701c03a6 100644 --- a/llvm/lib/Transforms/Yk/ModuleClone.cpp +++ b/llvm/lib/Transforms/Yk/ModuleClone.cpp @@ -75,14 +75,16 @@ struct YkModuleClone : public ModulePass { * If cloned function calls are identified within the original function * instructions, they are redirected to the original function instead. * - * **Example Scenario:** + * **Example Scenario (before calling `updateFunctionCalls` function):** * - Function `f` calls function `g`. - * - Function `g` is cloned as `__yk_clone_g`. + * - Function `g` is cloned as `__yk_clone_g` and all its callsites + * are updated appropriately. * - Function `f` is not cloned because its address is taken. * - As a result, function `f` calls `__yk_clone_g` instead of `g`. * * **Reasoning:** - * In `YkIRWriter` we only serialise non-cloned functions. + * In `YkIRWriter` we only serialise non-cloned functions. We want + * original functions to call only original functions. * * @param FinalModule The module containing both original and cloned * functions.