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

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 26 09:48:40 PST 2016


----- Original Message -----
> From: "Rafael EspĂ­ndola" <rafael.espindola at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "llvm-dev" <llvm-dev at lists.llvm.org>, "Arseny Kapoulkine" <arseny.kapoulkine at gmail.com>, "Yaron Keren"
> <yaron.keren at gmail.com>
> Sent: Tuesday, January 26, 2016 11:25:11 AM
> Subject: Re: [llvm-dev] lld: ELF/COFF main() interface
> 
> > I believe, however, that even when we want this functionality in a
> > library, we don't want the implementation to be "error_code
> > spaghetti."
> 
> My opinion too. If some utility code is really useful, sure, we add
> error_code and move it to llvm, but I would like to avoid having all
> of lld look like that.
> 
> > I propose that, for the purpose of treating lld as a library, we
> > enable exception handling and use C++ exceptions. All of my users
> > who use LLVM components as a library (for JIT, etc.) insist that I
> > build LLVM with exceptions (and RTTI for that matter) enabled. For
> > the purpose of creating a stand-alone lld build, we could
> > certainly build with exceptions disabled if that yields a
> > measurable performance difference.
> >
> > Thoughts?
> 
> Something along those lines should work. We would probably still need
> a diag handler, but it would now *not* be fatal and 'error' would
> look
> like
> 
> * call diag handler
> * if no exceptions, exit(1)
> * else, throw
> 
> The reason being that it is a lot easier to print errors close to
> where they are found and we want to do it when exceptions are
> disabled
> too.

I agree.

 -Hal

> 
> Thanks,
> Rafael
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-dev mailing list