]> granicus.if.org Git - clang/commitdiff
Update AST reader/writer to handle new AppleKext.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 7 Jan 2011 18:59:25 +0000 (18:59 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 7 Jan 2011 18:59:25 +0000 (18:59 +0000)
Fix an unexpected hickup caused by exceeding size of
generated table (and a misleading comment). Improve
on help message for -fapple-kext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123003 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticFrontendKinds.td
include/clang/Basic/DiagnosticIDs.h
include/clang/Driver/CC1Options.td
lib/Basic/DiagnosticIDs.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp

index 8ea904130cfd19b33b22336d669135efd1772793..263a6b1e3d9f310369227a3cfceab73573768bf7 100644 (file)
@@ -129,6 +129,9 @@ def warn_pch_nonfragile_abi2 : Error<
     "PCH file was compiled with the %select{32-bit|enhanced non-fragile}0 "
     "Objective-C ABI but the %select{32-bit|enhanced non-fragile}1 "
     "Objective-C ABI is selected">;
+def warn_pch_apple_kext : Error<
+    "PCH file was compiled %select{with|without}0 support for Apple's kernel "
+    "extensions ABI but it is currently %select{disabled|enabled}1">;
 def warn_pch_objc_auto_properties : Error<
     "PCH file was compiled %select{with|without}0 support for auto-synthesized "
     "@properties but it is currently %select{disabled|enabled}1">;
index eede94b2c5bd4095d59855479a693a6442dc00e5..9d18b0f9e950e592f60ee59e06ce7d8649d1a303 100644 (file)
@@ -27,7 +27,7 @@ namespace clang {
     enum {
       DIAG_START_DRIVER   =                        300,
       DIAG_START_FRONTEND = DIAG_START_DRIVER   +  100,
-      DIAG_START_LEX      = DIAG_START_FRONTEND +  100,
+      DIAG_START_LEX      = DIAG_START_FRONTEND +  120,
       DIAG_START_PARSE    = DIAG_START_LEX      +  300,
       DIAG_START_AST      = DIAG_START_PARSE    +  300,
       DIAG_START_SEMA     = DIAG_START_AST      +  100,
index 955ca72a2c3c2209ec616f51b573b1998afce464..58353f11b98ea1f323be01a100a1058eaab91d7b 100644 (file)
@@ -462,7 +462,7 @@ def fobjc_gc : Flag<"-fobjc-gc">,
 def fobjc_gc_only : Flag<"-fobjc-gc-only">,
   HelpText<"Use GC exclusively for Objective-C related memory management">;
 def fapple_kext : Flag<"-fapple-kext">,
-  HelpText<"Use apple's kext abi">;
+  HelpText<"Use Apple's kernel extensions ABI">;
 def fobjc_dispatch_method_EQ : Joined<"-fobjc-dispatch-method=">,
   HelpText<"Objective-C dispatch method to use">;
 def fobjc_default_synthesize_properties : Flag<"-fobjc-default-synthesize-properties">,
index 29a8d9270a9012cf0cad55a99824984336e248e2..df32c31ea9e72c2975f424b7808cfbb5891bcd2d 100644 (file)
@@ -82,7 +82,7 @@ static const StaticDiagInfoRec *GetDiagInfo(unsigned DiagID) {
     for (unsigned i = 1; i != NumDiagEntries; ++i) {
       assert(StaticDiagInfo[i-1].DiagID != StaticDiagInfo[i].DiagID &&
              "Diag ID conflict, the enums at the start of clang::diag (in "
-             "Diagnostic.h) probably need to be increased");
+             "DiagnosticIDs.h) probably need to be increased");
 
       assert(StaticDiagInfo[i-1] < StaticDiagInfo[i] &&
              "Improperly sorted diag info");
index 7c8415a295c1ba659c6c8f3c59a0201ac7b0c44a..d0edd71cd1e91400e95fea09142cd283f466167e 100644 (file)
@@ -84,6 +84,7 @@ PCHValidator::ReadLanguageOptions(const LangOptions &LangOpts) {
   PARSE_LANGOPT_IMPORTANT(ObjC2, diag::warn_pch_objective_c2);
   PARSE_LANGOPT_IMPORTANT(ObjCNonFragileABI, diag::warn_pch_nonfragile_abi);
   PARSE_LANGOPT_IMPORTANT(ObjCNonFragileABI2, diag::warn_pch_nonfragile_abi2);
+  PARSE_LANGOPT_IMPORTANT(AppleKext, diag::warn_pch_apple_kext);
   PARSE_LANGOPT_IMPORTANT(ObjCDefaultSynthProperties,
                           diag::warn_pch_objc_auto_properties);
   PARSE_LANGOPT_IMPORTANT(NoConstantCFStrings,
@@ -2600,6 +2601,7 @@ bool ASTReader::ParseLanguageOptions(
     PARSE_LANGOPT(ObjC2);
     PARSE_LANGOPT(ObjCNonFragileABI);
     PARSE_LANGOPT(ObjCNonFragileABI2);
+    PARSE_LANGOPT(AppleKext);
     PARSE_LANGOPT(ObjCDefaultSynthProperties);
     PARSE_LANGOPT(NoConstantCFStrings);
     PARSE_LANGOPT(PascalStrings);
index eb312522c7ade559224604e9642fce74cdc32ba1..52415b0d516a610770845bb6220609d75935b5bd 100644 (file)
@@ -882,6 +882,7 @@ void ASTWriter::WriteLanguageOptions(const LangOptions &LangOpts) {
                                                  // modern abi enabled.
   Record.push_back(LangOpts.ObjCNonFragileABI2); // Objective-C enhanced
                                                  // modern abi enabled.
+  Record.push_back(LangOpts.AppleKext);          // Apple's kernel extensions ABI
   Record.push_back(LangOpts.ObjCDefaultSynthProperties); // Objective-C auto-synthesized
                                                       // properties enabled.
   Record.push_back(LangOpts.NoConstantCFStrings); // non cfstring generation enabled..