<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jul 26, 2008, at 12:14, Simon Ask Ulsnes wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>2008/7/26 Gordon Henriksen <<a href="mailto:gordonhenriksen@me.com">gordonhenriksen@me.com</a>>:<br><blockquote type="cite">I'm not sure the purpose of doing so—llvm::Collector (poorly named; <span class="Apple-style-span" style="-webkit-text-stroke-width: -1; ">I'm open to suggestions) exists only in the compiler, not at runtime in the compiled program. You should need access to it at runtime no more than you might need access to an instance of llvm::TargetMachine.</span></blockquote><br>Maybe I don't understand the architecture correctly.<br><br>This means that the implementation of my collector's data structures (in this case, a few heaps) is supposed to be independent on the subclassed llvm::Collector?<br></div></blockquote><div><br></div><div>That's correct. llvm::Collector exists to coordinate the compiler and generate code <i>compatible with</i> your GC runtime library. It is not itself part of your GC runtime library.</div><div><br></div><blockquote type="cite"><div>I had initially implemented it as<br><br>class SimonCollector : public llvm::Collector<br>{<br>    public:<br>        // ... virtual methods from llvm::Collector<br><br>        void* allocate(...) { /* my allocator */ }<br>        void collect() { /* ... */ }<br>        // etc.<br>};<br><br>but actually allocate, collect, etc. aren't supposed to be there, but in some separate structure that is accessed by both my llvm::Collector subclass (or rather, the assembly generated in the lowering passes) and llvm_gc_*?</div></blockquote><div><br></div><div>Yes.</div><br><blockquote type="cite"><div>If that is the case, then I agree, it's a poor name -- at least it got me confused. :-P It's hard to come up with good alternatives, though. Hmm.<br><br>I looked a bit at the ShadowStackCollector class, and suddenly it makes much more sense. But I fail to find any implementations of llvm_gc_allocate and friends?<br></div></blockquote></div><div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Trebuchet MS; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br class="khtml-block-placeholder"></div><div>llvm_gc_* are optional interfaces. If you want your allocation routines to look different, then you're free to do so. I consider that section of the document deprecated to obsolete.</div><div><br></div><div>That said, they're not implemented by the Collector class, so you shouldn't expect to find them anywhere under llvm/lib. I believe the semispace example in llvm/runtime provides implementations of these interfaces, however.</div><div><br></div>— Gordon<br class="Apple-interchange-newline"></span></span></span></span></span></div></span> </div><br></body></html>