<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Lang, thanks again for your updates!<br>
      <br>
      <blockquote type="cite">The Extensible RTTI system (<a
          href="https://reviews.llvm.org/D39111">https://reviews.llvm.org/D39111</a>)
        that I posted a while back has landed. While this is not ORC
        specific, I expect it to be used in upcoming patches to allow
        ORC clients to check the dynamic type of MaterializationUnits.
        This can be used during dispatch to prioritize work by type,
        e.g. prioritizing stubs and other trivial-to-materialize
        symbols.</blockquote>
      This is great news! Looking forward to use it for dispatch in the
      ThinLtoJIT prototype once I resume to my LLVM work.<br>
      <br>
      On 20/04/2020 07:36, Lang Hames wrote:<br>
    </p>
    <blockquote type="cite"
cite="mid:CALLttgrvV9JZg7TLz7LTDvKO_CJDpwWsQ-A8w4hZ9=zXpcUHNg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">Hi All,
            <div><br>
            </div>
            <div>There was only one interesting ORC-specific commit this
              week: A new example showing how to initialize and
              de-initialize JITDylibs has been added in
              llvm/examples/OrcV2Examples/LLJITWithInitializers.</div>
            <div><br>
            </div>
            <div>The Extensible RTTI system (<a
                href="https://reviews.llvm.org/D39111"
                moz-do-not-send="true">https://reviews.llvm.org/D39111</a>)
              that I posted a while back has landed. While this is not
              ORC specific, I expect it to be used in upcoming patches
              to allow ORC clients to check the dynamic type of
              MaterializationUnits. This can be used during dispatch to
              prioritize work by type, e.g. prioritizing stubs and other
              trivial-to-materialize symbols.</div>
            <div><br>
            </div>
            <div>Finally, I hope to spend next week working on support
              for removable code in OrcV2, which is one of the big
              missing features from OrcV1. I expect the API to end up
              looking something like this:</div>
            <div><br>
            </div>
            <div><font face="monospace">using ResourceKey = const class
                ResourceTracker*;</font></div>
            <div><font face="monospace">class ResourceTracker {</font></div>
            <div><font face="monospace">public:</font></div>
            <div><font face="monospace">  // Return the key for this
                tracker (just its address)</font></div>
            <div><font face="monospace">  ResourceKey getKey() { return
                this; }</font></div>
            <div><font face="monospace"><br>
              </font></div>
            <div><font face="monospace">  // Emit all not-yet-emitted
                symbols covered by this tracker. </font></div>
            <div><font face="monospace">  Expected<SymbolMap>
                emit();</font></div>
            <div><font face="monospace"><br>
              </font></div>
            <div><font face="monospace">  // Remove all symbols covered
                by this tracker and</font></div>
            <div><font face="monospace">  // release resources.</font></div>
            <div><font face="monospace">  Error remove();</font></div>
            <div><font face="monospace"><br>
              </font></div>
            <div><font face="monospace">  // Transfer tracking of all
                symbols / resources to the</font></div>
            <div><font face="monospace">  // containing JITDylib's</font><span
                style="font-family:monospace"> tracker.</span></div>
            <div><font face="monospace">  void detach();</font></div>
            <div><font face="monospace">};</font></div>
            <div><br>
            </div>
            <div>I'm hoping that usage will look like:</div>
            <div><br>
            </div>
            <div><font face="monospace">LLJIT J =
                LLJITBuilder().create();</font></div>
            <div><font face="monospace"><br>
              </font></div>
            <div><font face="monospace">// No tracker specified.
                Resources tracked by the containing</font></div>
            <div><font face="monospace">// JITDylib's tracker, and freed
                when the JITDylib is</font></div>
            <div><font face="monospace">// deinitialized. </font></div>
            <div><font face="monospace">ExitOnErr(J.addIRModule(sdt::move(UntrackedModule)));</font></div>
            <div><font face="monospace"><br>
              </font></div>
            <div><font face="monospace">// Explicitly specify tracker.
                Module symbols can be</font></div>
            <div><font face="monospace">//  - materialized by calling
                T->emit();</font></div>
            <div><font face="monospace">//  - removed by calling
                T->remove();</font></div>
            <div><font face="monospace">//  - transfered to the JITDylib
                by calling T->release();</font></div>
            <div><font face="monospace">auto T =
                std::make_unique<ResourceTracker>();</font></div>
            <div><font face="monospace">ExitOnErr(J.addIRModule(TrackedModule,
                T->getKey()));</font></div>
            <div><br>
            </div>
            <div>Early feedback on this API sketch is welcome. Otherwise
              I hope to have early reviews / discussion ready in time
              for next week.</div>
            <div><br>
            </div>
            <div>-- Lang.</div>
          </div>
        </div>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="https://flowcrypt.com/pub/stefan.graenitz@gmail.com">https://flowcrypt.com/pub/stefan.graenitz@gmail.com</a></pre>
  </body>
</html>