<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/63233>63233</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Turning the compiler inside out
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Philius
      </td>
    </tr>
</table>

<pre>
    Before hearing that ORCv2 prevented defining the same function more than once, I had an idea about how to get around the problem, for example in Kaleidoscope.
Before creating the function, the process would fork, inheriting all the functions previously defined, sharing their memory.
The function definition would be entered as usual, but if the user wanted to redefine it, the program would end the child process(es) that defined it and fork a new process with the new definition.

Thus only the change requires code generation, all the rest is already in memory.

Then it struck me.
Compilers work by reading files and creating an in-memory representation,
Pre-compiled headers, even if memory mapped, need to page in data from disk.

But what if you stopped the compilation process after reading in all the headers but just before you read the source file, forked it, and for each fork, read in a source file, generated the object code, and exited.

This turns the compiler into an interpreter.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxcVM2O4joTfZpkU2oUHOCDRRbTPUL6dBd3dDUvUIkriQfHzi2Xm-Htr-wkdPesQJhz6vyUjSGYwRE1xfG1OH4vMcroufkxGmtiKFuvH80r9Z4JRkI2bgAZUeDvf97eFcxM7-SENGjqjVtOCQJOBH10nRjvYEpgGdGBdx0V6g3-DyNqQAdGEwK2PgqM_g7iYSABZB-dzkwz-9bSlEC9Z6DfOM2WwDj4Cy0Z7UPnZ9oV1fei-rbq7JhQNimbisSwEnYUAtx9tDpx3tKJcSOxySC09gswZJPGx2Afi0vSCRLGLQ0yDBNNnh-rjp-f4Gsw-esysyVIkTFpwAAxRLSJr40Cps-jYyCGO-ZcxQPTMhaMfHIxME4rI61hdaOxenNYqDOFQl2WulbhYATQLb4BwdH9IxAjY2ZJP36IXi1txmIA7-xjHYduIGD6NxqmAJ3XBAM5YtwS38JkCgImAFom1I_U35fEnrm5pDAIx-4G09brm59mY4lTa3yD9gGJJYXfG0shO3qWnrbKvSzswDQzBXKyKVoIfzC9dAupTmutiUOSm5Y5lbCiJ5znpWxHSxUzDnn5NApCz34CbcLti4nXKHBPkZseHj5CEJ9YlsTyzKzlmTv2Qvw0ZNwzs1VXXoxfMQi0y3on0vT35ab5yB3lHNY7csst5_CXooGwG5-bnpFpyp_QtbhVqW9_USe50o2Kfhsh_UdhJoBEduGTPWIwTvxShBDPTEK8K3VT60t9wZKa_el8qs-Hy-lYjo26VAelzqo7V9jh5Vy1h31f0emo6Pg_XVNpGlWpujrtq-q8P1XH3WGv9Knf94dL1dNxj8WhogmN3Vn7Pu08D6UJIVJzqlVdlxZbsiG_b0ql5c6HhVLpueMmYV7aOITiUFkTJHywiBFLzc_Iz4ftk8NgNIGPUka2zSgyh6L-Vqhroa6DkTG2u85PhbomtvXjZWafYi3UNWsIhbpmjf8FAAD__yBz52A">