<div dir="rtl"><div class="gmail_extra" dir="ltr">The context issue may be solved by making all functions and context data members of a class. Sort of having the convenience of global variables accessible from all linker functions but without the regular global variable problems of initializing and re-entry. so the class is suitable aspart of a library. Most clang and LLVM classes works this way, not passing contexts around.</div><div class="gmail_extra" dir="ltr"><br></div><div class="gmail_extra" dir="ltr"><br></div><div class="gmail_extra" dir="ltr"><div class="gmail_quote"><div>2016-01-22 6:25 GMT+02:00 Rui Ueyama via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span>:</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 class="gmail_quote"><div>There is a trade-off. In order to use main as a library function, all functions behind it have to pass around a context object, and all functions that possibly fail have to be wrapped with ErrorOr. Some functions don't need any context nor they never fail, so maybe we don't have to wrap every function. But if you later find some leaf function needs a context object or could fail, you've got to update all function that can reach there. It's not too hard, but it is all a bit of pain.</div></div></blockquote><div> </div></div></div></div>