<htmlxmlns="http://www.w3.org/1999/xhtml"><head><title>CCallSpecializedWithClosures (infer.ClangFrontend.CCallSpecializedWithClosures)</title><linkrel="stylesheet"href="../../../odoc.css"/><metacharset="utf-8"/><metaname="generator"content="odoc 1.5.1"/><metaname="viewport"content="width=device-width,initial-scale=1.0"/><scriptsrc="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><divclass="content"><header><nav><ahref="../index.html">Up</a>–<ahref="../../index.html">infer</a>»<ahref="../index.html">ClangFrontend</a>» CCallSpecializedWithClosures</nav><h1>Module <code>ClangFrontend.CCallSpecializedWithClosures</code></h1></header><aside><p>This preanalysis aims to create specialized clones of methods that have blocks as arguments and that are called with concrete closures, and then it calls these clone methods instead of the original ones. One complication is with the captured variables in the closure: we add them to the formals of the cloned method and pass them through to the concrete blocks. We do this transformation in two steps:</p><p>1. Go through all the callers of methods with blocks as parameters, and create the clone methods. In this preanalysis we only create the attributes for the new method, not the code. We also update the call instructions in the callers to represent a call to the cloned method with updated arguments: we don't need to pass closure's arguments anymore, we instead pass the captured variables as new arguments.</p><p>2. (In ClosureSubstSpecializedMethod.ml) We add the corresponding code to the newly created clones: this means swapping the call to the block variable with a call to the corresponding block. Moreover, we add some of the new formals (that correspond to the captured variables) to the arguments of the call.</p></aside><dl><dtclass="spec value"id="val-process"><ahref="#val-process"class="anchor"></a><code><spanclass="keyword">val</span> process : <ahref="../../IR/Cfg/index.html#type-t">IR.Cfg.t</a><span>-></span> unit</code></dt></dl></div></body></html>