[PATCH] D39673: Toolchain: Normalize dwarf, sjlj and seh eh

Martell Malone via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 5 23:08:36 PST 2017


martell created this revision.
Herald added a subscriber: aprantl.

Adds `-fseh-exceptions` and `-fdwarf-exceptions` to compliment `-fsjlj-exceptions`.

This makes the exception personality configurable at runtime rather then just compile time.

If nothing is passed to cc1 we default to `-fdwarf-exceptions`
The clang frontend will first check if the user has specified one of the above flags,
if not then it will check the target default and attach either `-fseh-exceptions` or
`-fsjlj-exceptions`. Attaching `-fdwarf-exceptions` is unnecessary because it is the
default and some of tests check for `-NOT: "exception"` when passing `-fno-exceptions`

The general rule of thumb here is `-fno-exceptions` has a higher priority then specifying
the exception type.

Other notable changes:

Move `__SEH__` macro definition out of Targets and into `InitPreprocessor` making
it dependant on `-fseh-exceptions`

Remove UseSEHExceptions from the MinGW Driver that doesn't actually do anything.


Repository:
  rL LLVM

https://reviews.llvm.org/D39673

Files:
  include/clang/Basic/LangOptions.def
  include/clang/Driver/Options.td
  include/clang/Driver/ToolChain.h
  lib/Basic/Targets/X86.h
  lib/CodeGen/BackendUtil.cpp
  lib/CodeGen/CGException.cpp
  lib/Driver/ToolChains/Clang.cpp
  lib/Driver/ToolChains/MinGW.cpp
  lib/Driver/ToolChains/MinGW.h
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/InitPreprocessor.cpp
  test/CodeGenCXX/mingw-w64-exceptions.c
  test/CodeGenCXX/mingw-w64-seh-exceptions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39673.121683.patch
Type: text/x-patch
Size: 11964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171106/9f3ad7ff/attachment-0001.bin>


More information about the cfe-commits mailing list