From 36981b17ed939300f6f8fc2355a255f711fcef71 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 20 Oct 2011 21:14:49 +0000 Subject: Vendor import of clang release_30 branch r142614: http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614 --- include/clang/Frontend/PreprocessorOptions.h | 36 ++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'include/clang/Frontend/PreprocessorOptions.h') diff --git a/include/clang/Frontend/PreprocessorOptions.h b/include/clang/Frontend/PreprocessorOptions.h index 2e16c97e7d432..0ee8cb38744a6 100644 --- a/include/clang/Frontend/PreprocessorOptions.h +++ b/include/clang/Frontend/PreprocessorOptions.h @@ -50,6 +50,10 @@ public: /// record of all macro definitions and /// expansions. + /// \brief Whether we should automatically translate #include or #import + /// operations into module imports when possible. + unsigned AutoModuleImport : 1; + /// \brief Whether the detailed preprocessing record includes nested macro /// expansions. unsigned DetailedRecordIncludesNestedMacroExpansions : 1; @@ -117,6 +121,14 @@ public: /// by providing appropriate definitions to retrofit the standard library /// with support for lifetime-qualified pointers. ObjCXXARCStandardLibraryKind ObjCXXARCStandardLibrary; + + /// \brief The path of modules being build, which is used to detect + /// cycles in the module dependency graph as modules are being built. + /// + /// There is no way to set this value from the command line. If we ever need + /// to do so (e.g., if on-demand module construction moves out-of-process), + /// we can add a cc1-level option to do so. + SmallVector ModuleBuildPath; typedef std::vector >::iterator remapped_file_iterator; @@ -154,6 +166,7 @@ public: public: PreprocessorOptions() : UsePredefines(true), DetailedRecord(false), + AutoModuleImport(false), DetailedRecordIncludesNestedMacroExpansions(true), DisablePCHValidation(false), DisableStatCache(false), DumpDeserializedPCHDecls(false), @@ -162,13 +175,13 @@ public: RetainRemappedFileBuffers(false), ObjCXXARCStandardLibrary(ARCXX_nolib) { } - void addMacroDef(llvm::StringRef Name) { + void addMacroDef(StringRef Name) { Macros.push_back(std::make_pair(Name, false)); } - void addMacroUndef(llvm::StringRef Name) { + void addMacroUndef(StringRef Name) { Macros.push_back(std::make_pair(Name, true)); } - void addRemappedFile(llvm::StringRef From, llvm::StringRef To) { + void addRemappedFile(StringRef From, StringRef To) { RemappedFiles.push_back(std::make_pair(From, To)); } @@ -176,7 +189,7 @@ public: return RemappedFiles.erase(Remapped); } - void addRemappedFile(llvm::StringRef From, const llvm::MemoryBuffer * To) { + void addRemappedFile(StringRef From, const llvm::MemoryBuffer * To) { RemappedFileBuffers.push_back(std::make_pair(From, To)); } @@ -189,6 +202,21 @@ public: RemappedFiles.clear(); RemappedFileBuffers.clear(); } + + /// \brief Reset any options that are not considered when building a + /// module. + void resetNonModularOptions() { + Includes.clear(); + MacroIncludes.clear(); + ChainedIncludes.clear(); + DumpDeserializedPCHDecls = false; + ImplicitPCHInclude.clear(); + ImplicitPTHInclude.clear(); + TokenCache.clear(); + RetainRemappedFileBuffers = true; + PrecompiledPreambleBytes.first = 0; + PrecompiledPreambleBytes.second = 0; + } }; } // end namespace clang -- cgit v1.2.3