[llvm-dev] lld: ELF/COFF main() interface

Yaron Keren via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 26 00:01:56 PST 2016


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.


2016-01-22 6:25 GMT+02:00 Rui Ueyama via llvm-dev <llvm-dev at lists.llvm.org>:

> 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160126/44a57471/attachment.html>


More information about the llvm-dev mailing list