[clang-cl] Disable C++ exceptions a different way
Rather than making -fexceptions a core option that enables C++ EH in
clang-cl, users can use the '-Xclang -fexceptions -Xclang
-fcxx-exceptions' flag set. We weren't going to expose -fexceptions in
clang-cl in the long run, so this way we don't add and then remove a
flag.
llvm-svn: 242176
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index d5ccc3c..8c11992 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -5086,13 +5086,9 @@
}
}
- // Only enable C++ exceptions if the user opts into it by passing
- // -fexceptions. Lots of build systems implicitly pass /EHsc when users don't
- // actually need it.
- // FIXME: Remove this when they work out of the box.
- if (!Args.hasFlag(options::OPT_fexceptions, options::OPT_fno_exceptions,
- /*default=*/false))
- EH = EHFlags();
+ // FIXME: Disable C++ EH completely, until it becomes more reliable. Users
+ // can use -Xclang to manually enable C++ EH until then.
+ EH = EHFlags();
return EH;
}