[clang] Multilib support for libraries with exceptions (PR #75031)

Michael Platings via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 2 06:38:09 PST 2024


================
@@ -77,10 +77,21 @@ static ToolChain::RTTIMode CalculateRTTIMode(const ArgList &Args,
   return NoRTTI ? ToolChain::RM_Disabled : ToolChain::RM_Enabled;
 }
 
+static ToolChain::ExceptionsMode CalculateExceptionsMode(const ArgList &Args) {
+
+  Arg *exceptionsArg = Args.getLastArg(options::OPT_fno_exceptions);
+  if (exceptionsArg &&
+      exceptionsArg->getOption().matches(options::OPT_fno_exceptions)) {
+    return ToolChain::EM_Disabled;
+  }
+  return ToolChain::EM_Enabled;
----------------
mplatings wrote:

This is incorrect. There are plenty of examples across the clang code of how to check whether exceptions should be enabled or not.

https://github.com/llvm/llvm-project/pull/75031


More information about the cfe-commits mailing list