Skip to content

Commit

Permalink
Add clarification comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel-Durov committed Nov 25, 2024
1 parent 0f3e89c commit 3462947
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions llvm/lib/Transforms/Yk/ModuleClone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3462947

Please sign in to comment.