<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div apple-content-edited="true"><div>Hi all,</div><div><br></div><div>In order to support linking AsmWriter separately from CodeGen, the <font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="background-color: transparent;"><font class="Apple-style-span" face="Courier">Collector</font></span></font> class (a CodeGen component) had to be decoupled from the <font class="Apple-style-span" face="Courier">AsmWriter</font> interface. This required moving the <font class="Apple-style-span" face="Courier">beginAssembly</font> and <font class="Apple-style-span" face="Courier">endAssembly</font> methods to a separate abstract base class. If you had overridden these methods, your class may compile successfully but fail at runtime with a message of the form:</div><div><br></div><div><font class="Apple-style-span" face="Courier">    no GCMetadataPrinter registered for collector: %s</font></div></div><div apple-content-edited="true"><br></div><div apple-content-edited="true">The fix is to transition your overrides to a subclass of <font class="Apple-style-span" face="Courier">GCMetadataPrinter</font>:</div><div apple-content-edited="true"><div><br></div><div> 1. Subclass <font class="Apple-style-span" face="Courier">GCMetadataPrinter</font> and move your <font class="Apple-style-span" face="Courier">beginAssembly</font> and <font class="Apple-style-span" face="Courier">endAssembly</font> implementations there. The <font class="Apple-style-span" face="Courier">GCMetadataPrinter</font> has the same data accessors as Collector (now <font class="Apple-style-span" face="Courier">GCStrategy</font>), so your implementation shouldn't need many changes.</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">      class BespokeGCPrinter : public GCMetadataPrinter {</font></div><div><font class="Apple-style-span" face="Courier">      public:</font></div><div><font class="Apple-style-span" face="Courier">        void beginAssembly(...) { ... }</font></div><font class="Apple-style-span" face="Courier">        void endAssembly(...) { ... }</font><div><font class="Apple-style-span" face="Courier">      };</font></div><br></div><div> 2. Register your printer with <font class="Apple-style-span" face="Courier">GCMetadataPrinterRegistry</font>.</div><div><div><br></div><div><font class="Apple-style-span" face="Courier">      GCMetadataPrinterRegistry::Add<BespokeGCPrinter></font></div><div><font class="Apple-style-span" face="Courier">      X("bespoke", "my bespoke");</font></div></div><div><br></div><div> 3. Set the new <font class="Apple-style-span" face="Courier">UsesMetadata</font> flag in your Collector subclass' constructor so that the <font class="Apple-style-span" face="Courier">AsmWriter</font> will look for your assembly printer:</div><div><br></div><div><font class="Apple-style-span" face="Courier">      MyGC::MyGC() {</font></div><div><font class="Apple-style-span" face="Courier">        ...</font></div><div><font class="Apple-style-span" face="Courier">        UsesMetadata = true;</font></div><div><font class="Apple-style-span" face="Courier">      }</font></div><div><br></div><div><br></div><div><div apple-content-edited="true"><div>In addition, I took the breaking change as an opportunity to rename some classes so that their role will hopefully be clearer. In particular, Collector was confusing to implementors. Several thought that this compile-time class was the place to implement their runtime GC heap. Of course, it doesn't even exist at runtime.</div><div><br></div><div>Specifically, the renames are:</div><div><br></div><div><font class="Apple-style-span" face="Courier">  Collector               -> GCStrategy</font></div><div><font class="Apple-style-span" face="Courier">  CollectorMetadata       -> GCFunctionInfo</font></div><font class="Apple-style-span" face="Courier">  CollectorModuleMetadata -> GCModuleInfo</font></div><div apple-content-edited="true"><font class="Apple-style-span" face="Courier">  CollectorRegistry       -> GCRegistry</font></div><div apple-content-edited="true"><font class="Apple-style-span" face="Courier">  Function::getCollector  -> getGC [setGC, hasGC, clearGC]</font></div><div apple-content-edited="true"><br></div><div apple-content-edited="true">Several accessors and nested types have also been renamed to be consistent. These changes should be obvious.</div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><br></div><div apple-content-edited="true">Please let me know if you have any questions!</div><div apple-content-edited="true"><br></div><div apple-content-edited="true">Thanks,</div></div><div><div>Gordon</div></div> </div><br><div><br></div><div><div>P.S. Sorry for the short notice; this just came up yesterday.</div><div><br></div></div></body></html>