<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>BTW, what do you think of my new patch?</div><br><div><div>On Sep 12, 2013, at 4:38 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr">On Thu, Sep 12, 2013 at 2:13 PM, Filip Pizlo<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:fpizlo@apple.com" target="_blank">fpizlo@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;"><div style="word-wrap: break-word;"><div class="im"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr"><snip></div></div></blockquote></div><div><br></div><div>I know that you could argue that clients of LLVM should always call llvm_shutdown().  This will probably work for a lot of clients where the relationship between the outer application and LLVM isn't transitive through multiple intervening libraries.  We certainly can't change our API to require our client to destroy the global VM, and it would be silly if that blocked us from ever using LLVM to compile any code due to exit-time crashes.</div></div></blockquote><div><br></div><div>You know, clang might not even call llvm_shutdown() if -disable_free is set, and that should be fine.  :)</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;"><div class="im"><blockquote type="cite"><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div dir="ltr"><div><br></div><div>Then we could convert llvm::outs() to use it, thereby potential initialization races on Windows.</div></div></div></blockquote></div></div></blockquote><div>Er, "thereby *fixing* potential races"</div><div><br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;">Interesting.  Can you elaborate what the problem is there?</div></blockquote><div><br></div><div>llvm::outs() has a static local that closes stdout in its destructor.  Obviously, this *really* has to run atexit, and probably can't run at llvm_shutdown() time.  Alternatively, it shouldn't close stdout.</div></div></div></div></div></blockquote><br></div><div dir="auto">Is the issue just that you want it to flush its output?</div><div dir="auto"><br></div><div dir="auto">In that case why not do the equivalent of _setvbuf?</div><div dir="auto"><br></div><div dir="auto">-Filip</div><div dir="auto"><br></div><br></body></html>