From fb3043d62708f182b7387924456c2282d374a9ef Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Mon, 11 Aug 2008 17:36:14 +0000 Subject: Add -fexceptions to Driver - Maps to LangOptions.Exceptions - Currently always off, should autoselect based on language. Update CodeGen to set unwind attribute on functions definitions based on LangOptions.Exceptions. - Still need to set attributes appropriately on calls. llvm-svn: 54643 --- clang/Driver/clang.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/Driver/clang.cpp') diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 05befe08c12..c55aa17eb2b 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -362,6 +362,17 @@ LaxVectorConversions("flax-vector-conversions", " with a different number of elements or " "different element types")); +// FIXME: This (and all GCC -f options) really come in -f... and +// -fno-... forms, and additionally support automagic behavior when +// they are not defined. For example, -fexceptions defaults to on or +// off depending on the language. We should support this behavior in +// some form (perhaps just add a facility for distinguishing when an +// has its default value from when it has been set to its default +// value). +static llvm::cl::opt +Exceptions("fexceptions", + llvm::cl::desc("Enable support for exception handling.")); + // FIXME: add: // -ansi // -trigraphs @@ -427,6 +438,7 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK) { Options.Microsoft = MSExtensions; Options.WritableStrings = WritableStrings; Options.LaxVectorConversions = LaxVectorConversions; + Options.Exceptions = Exceptions; } static llvm::cl::opt -- cgit v1.2.3