[cfe-dev] clang-cl equivalent option for VC++'s /EH(x)

Charles Davis cdavis5x at gmail.com
Thu Dec 5 20:42:27 PST 2013


On Nov 20, 2013, at 3:15 PM, Edward Diener wrote:

> On 11/20/2013 1:15 PM, Reid Kleckner wrote:
>> clang-cl currently does not expose this option because LLVM doesn't
>> support VC++-compatible 32-bit exception handling today.  However, I
>> believe it *does* support win64 exceptions, but I haven't tested it
>> personally.
> 
> What do you mean by "win64" exceptions ?
We mean the table-based exception handling model used by Windows/x64, as opposed to the frame-based model used by Windows/x86.
> 
>> 
>> LLVM will probably never support the full asynchronous exception model
>> of MSVC because it won't ever model control flow from each load, store,
>> or div that might trap to associated cleanup code.
>> 
>> I would support wiring up /EH(x) to support C++ exceptions on win64, and
>> warning that we're ignoring it on 32-bit Windows like we do today.  We
>> should probably warn on the 'a' modifier, since we won't implement it.
> 
> Does clang-cl therefore automatically handle synchronous C++ exceptions and not handle asynchronous structured error handling exceptions ?
It doesn't handle anything at the moment, at all. And even if the Win64 table-based SEH support were finished, the MSVC ABI (which clang-cl uses by default, I believe) still won't magically grow EH support, because RTTI needs to be implemented first. (Frame-based SEH for 32-bit x86 is yet another matter.)
> 
> Does it do anything about extern "C" functions which may or may not throw exceptions, or is this just a VC++-ism irrelevant to clang-cl ?
Don't worry, we just haven't gotten around to implementing that particular functionality yet. As always, patches welcome. ;)

Chip

> 
>> 
>> 
>> On Tue, Nov 19, 2013 at 9:53 PM, Edward Diener
>> <eldlistmailingz at tropicsoft.com
>> <mailto:eldlistmailingz at tropicsoft.com>> wrote:
>> 
>>    Does clang-cl have any equivalent option for VC++'s /EH(x) series of
>>    choices for exception handling and asynchronous exception handling
>>    when compiling under Windows using the VC++ RTL, since it does not
>>    support the /EH(x) compiler flags ?
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list