]> granicus.if.org Git - clang/commitdiff
Eliminate the -chained-pch flag and all of the frontend and libclang options associat...
authorDouglas Gregor <dgregor@apple.com>
Thu, 25 Aug 2011 22:54:01 +0000 (22:54 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 25 Aug 2011 22:54:01 +0000 (22:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138597 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/clang-c/Index.h
include/clang/Driver/CC1Options.td
include/clang/Frontend/ASTUnit.h
include/clang/Frontend/FrontendOptions.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/CompilerInvocation.cpp
test/PCH/chain-decls.c
test/PCH/chain-ext_vector.c
test/PCH/chain-external-defs.c
test/PCH/chain-macro-override.c
test/PCH/chain-macro.c
test/PCH/chain-predecl.m
test/PCH/chain-remap-types.m
test/PCH/chain-selectors.m
test/PCH/chain-trivial.c
tools/libclang/CIndex.cpp

index e16a21ef3593a932cf850799abe12502f0fe1e68..7c322504381e83e46771618e4242186f3d59fdd9 100644 (file)
@@ -824,18 +824,18 @@ enum CXTranslationUnit_Flags {
    */
   CXTranslationUnit_CacheCompletionResults = 0x08,
   /**
-   * \brief Enable precompiled preambles in C++.
+   * \brief DEPRECATED: Enable precompiled preambles in C++.
    *
    * Note: this is a *temporary* option that is available only while
-   * we are testing C++ precompiled preamble support.
+   * we are testing C++ precompiled preamble support. It is deprecated.
    */
   CXTranslationUnit_CXXPrecompiledPreamble = 0x10,
 
   /**
-   * \brief Enabled chained precompiled preambles in C++.
+   * \brief DEPRECATED: Enabled chained precompiled preambles in C++.
    *
    * Note: this is a *temporary* option that is available only while
-   * we are testing C++ precompiled preamble support.
+   * we are testing C++ precompiled preamble support. It is deprecated.
    */
   CXTranslationUnit_CXXChainedPCH = 0x20,
   
index 2c3bfc07a09a709a0e5a292f4f17c75e01254070..322aef41b7ef578a76207aa26d5873b2acc6ba28 100644 (file)
@@ -412,8 +412,6 @@ def working_directory_EQ : Joined<"-working-directory=">,
 
 def relocatable_pch : Flag<"-relocatable-pch">,
   HelpText<"Whether to build a relocatable precompiled header">;
-def chained_pch : Flag<"-chained-pch">,
-  HelpText<"Whether to chain the new precompiled header to the old one.">;
 def print_stats : Flag<"-print-stats">,
   HelpText<"Print performance metrics and statistics">;
 def ftime_report : Flag<"-ftime-report">,
index 08b626facc88a820e5087012630eb216e0b151c0..190ab857132bede5557c86907a55dbcc2698cd94 100644 (file)
@@ -651,8 +651,6 @@ public:
                                       bool PrecompilePreamble = false,
                                       TranslationUnitKind TUKind = TU_Complete,
                                       bool CacheCodeCompletionResults = false,
-                                      bool CXXPrecompilePreamble = false,
-                                      bool CXXChainedPCH = false,
                                       bool NestedMacroExpansions = true);
   
   /// \brief Reparse the source files using the same command-line options that
index 75e3eba80cd418a9f2b4fa8e37ca88713b50209d..ec75b59c4e3ecbdd0e14624e50d94d4503d1c6c1 100644 (file)
@@ -59,9 +59,6 @@ public:
   unsigned RelocatablePCH : 1;             ///< When generating PCH files,
                                            /// instruct the AST writer to create
                                            /// relocatable PCH files.
-  unsigned ChainedPCH : 1;                 ///< When generating PCH files,
-                                           /// instruct the AST writer to create
-                                           /// chained PCH files.
   unsigned ShowHelp : 1;                   ///< Show the -help text.
   unsigned ShowMacrosInCodeCompletion : 1; ///< Show macros in code completion
                                            /// results.
@@ -135,7 +132,6 @@ public:
     ProgramAction = frontend::ParseSyntaxOnly;
     ActionName = "";
     RelocatablePCH = 0;
-    ChainedPCH = 0;
     ShowHelp = 0;
     ShowMacrosInCodeCompletion = 0;
     ShowCodePatternsInCodeCompletion = 0;
index e3d56367fd42d622e881b576ddb21b2a4a939b5d..4a5a29a9c91d745e97dba7c613b751264c055861 100644 (file)
@@ -1354,7 +1354,6 @@ llvm::MemoryBuffer *ASTUnit::getMainBufferWithPrecompiledPreamble(
   
   // Tell the compiler invocation to generate a temporary precompiled header.
   FrontendOpts.ProgramAction = frontend::GeneratePCH;
-  FrontendOpts.ChainedPCH = true;
   // FIXME: Generate the precompiled header into memory?
   FrontendOpts.OutputFile = PreamblePCHPath;
   PreprocessorOpts.PrecompiledPreambleBytes.first = 0;
@@ -1761,8 +1760,6 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
                                       bool PrecompilePreamble,
                                       TranslationUnitKind TUKind,
                                       bool CacheCodeCompletionResults,
-                                      bool CXXPrecompilePreamble,
-                                      bool CXXChainedPCH,
                                       bool NestedMacroExpansions) {
   if (!Diags.getPtr()) {
     // No diagnostics engine was provided, so create our own diagnostics object
@@ -1805,16 +1802,6 @@ ASTUnit *ASTUnit::LoadFromCommandLine(const char **ArgBegin,
   // Override the resources path.
   CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath;
 
-  // Check whether we should precompile the preamble and/or use chained PCH.
-  // FIXME: This is a temporary hack while we debug C++ chained PCH.
-  if (CI->getLangOpts().CPlusPlus) {
-    PrecompilePreamble = PrecompilePreamble && CXXPrecompilePreamble;
-    
-    if (PrecompilePreamble && !CXXChainedPCH &&
-        !CI->getPreprocessorOpts().ImplicitPCHInclude.empty())
-      PrecompilePreamble = false;
-  }
-  
   // Create the AST unit.
   llvm::OwningPtr<ASTUnit> AST;
   AST.reset(new ASTUnit(false));
index 763c8a1e8bd6ddfb572bf3607037bb420ffbf206..aee69083c13127136e803b5c4041d7597a24f32c 100644 (file)
@@ -405,8 +405,6 @@ static void FrontendOptsToArgs(const FrontendOptions &Opts,
     Res.push_back("-disable-free");
   if (Opts.RelocatablePCH)
     Res.push_back("-relocatable-pch");
-  if (Opts.ChainedPCH)
-    Res.push_back("-chained-pch");
   if (Opts.ShowHelp)
     Res.push_back("-help");
   if (Opts.ShowMacrosInCodeCompletion)
@@ -1271,7 +1269,6 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
   Opts.OutputFile = Args.getLastArgValue(OPT_o);
   Opts.Plugins = Args.getAllArgValues(OPT_load);
   Opts.RelocatablePCH = Args.hasArg(OPT_relocatable_pch);
-  Opts.ChainedPCH = Args.hasArg(OPT_chained_pch);
   Opts.ShowHelp = Args.hasArg(OPT_help);
   Opts.ShowMacrosInCodeCompletion = Args.hasArg(OPT_code_completion_macros);
   Opts.ShowCodePatternsInCodeCompletion
index b3daa4a7b7cd998f84630902c3ccd716855a778c..f5724c4c1343736b6679c03090a9f702785c3b76 100644 (file)
@@ -3,7 +3,7 @@
 
 // Test with pch.
 // RUN: %clang_cc1 -emit-pch -o %t1 %S/Inputs/chain-decls1.h
-// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-decls2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-decls2.h -include-pch %t1
 // RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
 // RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
 
index 263507003d18df9c963104a1c45f73665ec5afd9..d99a732f2ffaf8e7ca0899b936e64071dc3b5182 100644 (file)
@@ -3,7 +3,7 @@
 
 // Test with pch.
 // RUN: %clang_cc1 -emit-pch -o %t1 %S/Inputs/chain-ext_vector1.h
-// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-ext_vector2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-ext_vector2.h -include-pch %t1
 // RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
 
 int test(float4 f4) {
index dd92d8e63ac66a743ccbb21f11e785f08a051623..7422294428650be183ceaa0834a6f95094ab14d9 100644 (file)
@@ -1,6 +1,6 @@
 // Test with pch.
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h
-// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch -chained-pch
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t2.pch -emit-llvm -o %t %s
 // RUN: echo FINI >> %t
 // RUN: FileCheck -input-file=%t -check-prefix=Z %s
index 8e208815fb26442fae3c6748f1953ae3e0fa7db8..2713e7084a9d2610a6227d0419e82a699fce2556 100644 (file)
@@ -3,7 +3,7 @@
 
 // Test with pch.
 // RUN: %clang_cc1 -emit-pch -o %t1 %S/Inputs/chain-macro-override1.h -detailed-preprocessing-record 
-// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-macro-override2.h -include-pch %t1 -chained-pch -detailed-preprocessing-record 
+// RUN: %clang_cc1 -emit-pch -o %t2 %S/Inputs/chain-macro-override2.h -include-pch %t1 -detailed-preprocessing-record 
 // RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
 
 int foo() {
index 68b18deb0811dde638cbbb852bc79e8053cb814f..18356f75a0e2b1649cf1a5e585b158c511b0b6df 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-pch -o %t1 -detailed-preprocessing-record %S/Inputs/chain-macro1.h
-// RUN: %clang_cc1 -emit-pch -o %t2 -detailed-preprocessing-record %S/Inputs/chain-macro2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -emit-pch -o %t2 -detailed-preprocessing-record %S/Inputs/chain-macro2.h -include-pch %t1
 // RUN: %clang_cc1 -fsyntax-only -verify -include-pch %t2 %s
 // RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
 
index 2b0444e15a2cef52ee210e4e650a9a747d9601ec..6723b6f6f2531cfbaf780d659e9de5f70d73be91 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-pch -o %t1 %S/chain-predecl.h -x objective-c
-// RUN: %clang_cc1 -emit-pch -o %t2 %s -x objective-c -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -emit-pch -o %t2 %s -x objective-c -include-pch %t1
 
 // Test predeclarations across chained PCH.
 @interface Foo
index a45a79d75c7f222a5d7173f84672e006b25a07e7..7886332fafe738e187e9d7d0ea5efb68b91cd7a8 100644 (file)
@@ -1,5 +1,5 @@
 // RUN: %clang_cc1 -emit-pch -x objective-c-header -o %t1 %S/Inputs/chain-remap-types1.h
-// RUN: %clang_cc1 -emit-pch -x objective-c-header -o %t2 %S/Inputs/chain-remap-types2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -emit-pch -x objective-c-header -o %t2 %S/Inputs/chain-remap-types2.h -include-pch %t1
 // RUN: %clang_cc1 -include-pch %t2 -fsyntax-only -verify %s
 // RUN: %clang_cc1 -ast-print -include-pch %t2 %s | FileCheck %s
 
index 3b19172799c537ecf7de7fbbe249da4706402a7a..c543b7106d5a0229157224f839c0f9d9a8bdb2d8 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wselector -include %S/Inputs/chain-selectors1.h -include %S/Inputs/chain-selectors2.h
 
 // RUN: %clang_cc1 -x objective-c -emit-pch -o %t1 %S/Inputs/chain-selectors1.h
-// RUN: %clang_cc1 -x objective-c -emit-pch -o %t2 %S/Inputs/chain-selectors2.h -include-pch %t1 -chained-pch
+// RUN: %clang_cc1 -x objective-c -emit-pch -o %t2 %S/Inputs/chain-selectors2.h -include-pch %t1
 // RUN: %clang_cc1 -fsyntax-only -verify %s -Wselector -include-pch %t2
 
 @implementation X
index c78b0e44ef30a42c730f71faf903b4cab73ff060..85b1eabd86f83666d80db61b8a062c044de3bdc8 100644 (file)
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t1 %S/Inputs/chain-trivial1.h
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t2 -include-pch %t1 -chained-pch %S/Inputs/chain-trivial2.h
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t2 -include-pch %t1 %S/Inputs/chain-trivial2.h
 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-print -include-pch %t2 %s | FileCheck %s
 // CHECK: struct __va_list_tag {
index 5837e0412d92a049f8db4ad5d9ad659d69403054..c7e492e074aea2a105e78f477b6c514ec84b3c41 100644 (file)
@@ -2414,9 +2414,7 @@ CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx,
 
 unsigned clang_defaultEditingTranslationUnitOptions() {
   return CXTranslationUnit_PrecompiledPreamble | 
-         CXTranslationUnit_CacheCompletionResults |
-         CXTranslationUnit_CXXPrecompiledPreamble |
-         CXTranslationUnit_CXXChainedPCH;
+         CXTranslationUnit_CacheCompletionResults;
 }
   
 CXTranslationUnit
@@ -2467,10 +2465,6 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
     = (options & CXTranslationUnit_Incomplete)? TU_Prefix : TU_Complete;
   bool CacheCodeCompetionResults
     = options & CXTranslationUnit_CacheCompletionResults;
-  bool CXXPrecompilePreamble
-    = options & CXTranslationUnit_CXXPrecompiledPreamble;
-  bool CXXChainedPCH
-    = options & CXTranslationUnit_CXXChainedPCH;
   
   // Configure the diagnostics.
   DiagnosticOptions DiagOpts;
@@ -2556,8 +2550,6 @@ static void clang_parseTranslationUnit_Impl(void *UserData) {
                                  PrecompilePreamble,
                                  TUKind,
                                  CacheCodeCompetionResults,
-                                 CXXPrecompilePreamble,
-                                 CXXChainedPCH,
                                  NestedMacroExpansions));
 
   if (NumErrors != Diags->getClient()->getNumErrors()) {