[clang] Add -fignore-exceptions
authorjasonliu <jasonliu.development@gmail.com>
Tue, 11 Feb 2020 09:52:56 +0000 (09:52 +0000)
committerjasonliu <jasonliu.development@gmail.com>
Wed, 12 Feb 2020 09:56:18 +0000 (09:56 +0000)
commit55e2678fcd4d7eca3f9a602a919da499c1103041
treeb0123eaff54b9b56849327e2382d391fe1dd821e
parentfa74b31a3e9cd844c7ce2087978568e3f5ec8519
[clang] Add -fignore-exceptions

Summary:

This is trying to implement the functionality proposed in:
http://lists.llvm.org/pipermail/cfe-dev/2017-April/053417.html
An exception can throw, but no cleanup is going to happen.
A module compiled with exceptions on, can catch the exception throws
from module compiled with -fignore-exceptions.

The use cases for enabling this option are:
1. Performance analysis of EH instrumentation overhead
2. The ability to QA non EH functionality when EH functionality is not available.
3. User of EH enabled headers knows the calls won't throw in their program and
   wants the performance gain from ignoring EH construct.

The implementation tried to accomplish that by removing any landing pad code
 that might get generated.

Reviewed by: aaron.ballman

Differential Revision: https://reviews.llvm.org/D72644
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CGException.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/ignore-exceptions.cpp [new file with mode: 0644]