You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.0 KiB

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>ClangFrontend__CCallSpecializedWithClosures (infer.ClangFrontend__CCallSpecializedWithClosures)</title><link rel="stylesheet" href="../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> <a href="../index.html">infer</a> &#x00BB; ClangFrontend__CCallSpecializedWithClosures</nav><h1>Module <code>ClangFrontend__CCallSpecializedWithClosures</code></h1><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></header><dl><dt class="spec value" id="val-process"><a href="#val-process" class="anchor"></a><code><span class="keyword">val</span> process : <a href="../IR/Cfg/index.html#type-t">IR.Cfg.t</a> <span>&#45;&gt;</span> unit</code></dt></dl></div></body></html>