From 55e2678fcd4d7eca3f9a602a919da499c1103041 Mon Sep 17 00:00:00 2001 From: jasonliu Date: Tue, 11 Feb 2020 09:52:56 +0000 Subject: [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/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index dca8056..2a7ec58 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2773,6 +2773,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, if (Args.hasArg(OPT_fno_threadsafe_statics)) Opts.ThreadsafeStatics = 0; Opts.Exceptions = Args.hasArg(OPT_fexceptions); + Opts.IgnoreExceptions = Args.hasArg(OPT_fignore_exceptions); Opts.ObjCExceptions = Args.hasArg(OPT_fobjc_exceptions); Opts.CXXExceptions = Args.hasArg(OPT_fcxx_exceptions); -- cgit v1.1