]> granicus.if.org Git - clang/commitdiff
Add a CXXExceptions flag to LangOptions.
authorAnders Carlsson <andersca@mac.com>
Wed, 23 Feb 2011 03:04:54 +0000 (03:04 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 23 Feb 2011 03:04:54 +0000 (03:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126299 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticFrontendKinds.td
include/clang/Basic/LangOptions.h
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp

index 5f9f4a7f3927e27dc36102a02746dae5a4a5b9fd..30706769d45e43f696acdb489ded3d6850075763 100644 (file)
@@ -177,12 +177,15 @@ def warn_pch_elide_constructors : Error<
 def warn_pch_exceptions : Error<
     "exceptions were %select{disabled|enabled}0 in PCH file but "
     "are currently %select{disabled|enabled}1">;
-def warn_pch_sjlj_exceptions : Error<
-    "sjlj-exceptions were %select{disabled|enabled}0 in PCH file but "
-    "are currently %select{disabled|enabled}1">;
 def warn_pch_objc_exceptions : Error<
     "Objective-C exceptions were %select{disabled|enabled}0 in PCH file but "
     "are currently %select{disabled|enabled}1">;
+def warn_pch_cxx_exceptions : Error<
+    "C++ exceptions were %select{disabled|enabled}0 in PCH file but "
+    "are currently %select{disabled|enabled}1">;
+def warn_pch_sjlj_exceptions : Error<
+    "sjlj-exceptions were %select{disabled|enabled}0 in PCH file but "
+    "are currently %select{disabled|enabled}1">;
 def warn_pch_objc_runtime : Error<
     "PCH file was compiled with the %select{NeXT|GNU}0 runtime but the "
     "%select{NeXT|GNU}1 runtime is selected">;
index f4db55ae062641a981562805bcb73771cd193023..0bd983e8e6c68a1dbc307b924905ae080d057268 100644 (file)
@@ -53,8 +53,9 @@ public:
   unsigned LaxVectorConversions : 1;
   unsigned AltiVec           : 1;  // Support AltiVec-style vector initializers.
   unsigned Exceptions        : 1;  // Support exception handling.
-  unsigned SjLjExceptions    : 1;  // Use setjmp-longjump exception handling.
   unsigned ObjCExceptions    : 1;  // Support Objective-C exceptions.
+  unsigned CXXExceptions     : 1;  // Support C++ exceptions.
+  unsigned SjLjExceptions    : 1;  // Use setjmp-longjump exception handling.
   unsigned RTTI              : 1;  // Support RTTI information.
 
   unsigned MSBitfields       : 1; // MS-compatible structure layout
@@ -165,8 +166,8 @@ public:
     NoConstantCFStrings = 0; InlineVisibilityHidden = 0;
     C99 = Microsoft = Borland = CPlusPlus = CPlusPlus0x = 0;
     CXXOperatorNames = PascalStrings = WritableStrings = ConstStrings = 0;
-    Exceptions = SjLjExceptions = Freestanding = NoBuiltin = 0;
-    ObjCExceptions = 1;
+    Exceptions = ObjCExceptions = CXXExceptions = SjLjExceptions = 0;
+    Freestanding = NoBuiltin = 0;
     MSBitfields = 0;
     NeXTRuntime = 1;
     RTTI = 1;
index ce87b11c2695cb4082abfde13cfeca29906b1360..150ad17901f9956b18e0fbfe6f75ad70bdddbc5b 100644 (file)
@@ -97,8 +97,9 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
                           diag::warn_pch_lax_vector_conversions);
   PARSE_LANGOPT_IMPORTANT(AltiVec, diag::warn_pch_altivec);
   PARSE_LANGOPT_IMPORTANT(Exceptions, diag::warn_pch_exceptions);
-  PARSE_LANGOPT_IMPORTANT(SjLjExceptions, diag::warn_pch_sjlj_exceptions);
   PARSE_LANGOPT_IMPORTANT(ObjCExceptions, diag::warn_pch_objc_exceptions);
+  PARSE_LANGOPT_IMPORTANT(CXXExceptions, diag::warn_pch_cxx_exceptions);
+  PARSE_LANGOPT_IMPORTANT(SjLjExceptions, diag::warn_pch_sjlj_exceptions);
   PARSE_LANGOPT_IMPORTANT(MSBitfields, diag::warn_pch_ms_bitfields);
   PARSE_LANGOPT_IMPORTANT(NeXTRuntime, diag::warn_pch_objc_runtime);
   PARSE_LANGOPT_IMPORTANT(Freestanding, diag::warn_pch_freestanding);
@@ -2799,8 +2800,9 @@ bool ASTReader::ParseLanguageOptions(
     PARSE_LANGOPT(LaxVectorConversions);
     PARSE_LANGOPT(AltiVec);
     PARSE_LANGOPT(Exceptions);
-    PARSE_LANGOPT(SjLjExceptions);
     PARSE_LANGOPT(ObjCExceptions);
+    PARSE_LANGOPT(CXXExceptions);
+    PARSE_LANGOPT(SjLjExceptions);
     PARSE_LANGOPT(MSBitfields);
     PARSE_LANGOPT(NeXTRuntime);
     PARSE_LANGOPT(Freestanding);
index 8fcb535a9c891f280226cbc61713ad53ecb142bc..b1edf95b9f9700f0290c9e7307db560a4863f16b 100644 (file)
@@ -1023,8 +1023,9 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
   Record.push_back(LangOpts.LaxVectorConversions);
   Record.push_back(LangOpts.AltiVec);
   Record.push_back(LangOpts.Exceptions);  // Support exception handling.
-  Record.push_back(LangOpts.SjLjExceptions);
   Record.push_back(LangOpts.ObjCExceptions);
+  Record.push_back(LangOpts.CXXExceptions);
+  Record.push_back(LangOpts.SjLjExceptions);
 
   Record.push_back(LangOpts.MSBitfields); // MS-compatible structure layout
   Record.push_back(LangOpts.NeXTRuntime); // Use NeXT runtime.