DMD Backend Long-term

"Jérôme M. Berger" jeberger at free.fr
Wed Jun 23 12:02:45 PDT 2010


bearophile wrote:
> Robert Jacques:
>> The patent seems to be Borlands's:
>> USPTO patent #5,628,016 Patent held by Borland on compiler support for SEH.
>>  From a Wine wiki page: http://wiki.winehq.org/CompilerExceptionSupport
>>
>> It does seem to expire on June 15, 2014, though and I assume DigitalMars  
>> has a license, so a LLVM fork is not unreasonable.
> 
> On Windows G++ supports exceptions. I have two questions:
> 1) Do you know how they do this? Do they have a license? If they have a licence why don't LLVM people too have it?

	Gcc has two ways to do this:
 * Using setjump/longjump. This works across foreign DLL calls, but
incurs a small performance penalty even if no exception is thrown
(setjmp needs to be called for each stack frame which will require
cleanup in case of exception);

 * Embedding dwarf information in the executable to allow stack
unwinding. This only works if all the stack frames where an
exception may occur where compiled with gcc (i.e you may call
foreign DLLs, but if you give them a callback then this callback may
not throw). This has absolutely no performance penalty so long as no
exception is thrown.

	Neither approach is compatible with MS exception handling, so you
can't call an MS C++ DLL and catch the exceptions it throws, and if
you call a DLL and give it a callback and your callback throws then
the cleanup code in the DLL won't be run (and vice versa of course).
SEH would allow this to work.

> 2) Why isn't LLVM just copying that part of the GCC code? If a true copy is not possible, why aren't copying the code with enough cosmetic changes? (A good amount of time ago I did believe that the main purpose of the Open Source idea was to copy source code between projects, to avoid reinventing things. I was so wrong.)
> 
	The way I understood it, it was mostly a matter of manpower. Most
LLVM devs are on MacOS. Posix platforms are close enough to MacOS
that they can get by with less porting effort (plus they probably
have more motivated devs than Windows), so they are not too far
behind, but Windows is another matter.

		Jerome
-- 
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100623/d42f914a/attachment.pgp>


More information about the Digitalmars-d mailing list