From c72c57c9e9b69944e3e009cd5e209634839581d3 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 8 Apr 2013 18:45:10 +0000 Subject: Vendor import of clang trunk r178860: http://llvm.org/svn/llvm-project/cfe/trunk@178860 --- include/clang/Lex/PreprocessorOptions.h | 52 ++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 20 deletions(-) (limited to 'include/clang/Lex/PreprocessorOptions.h') diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h index e5fe373..eba2a13 100644 --- a/include/clang/Lex/PreprocessorOptions.h +++ b/include/clang/Lex/PreprocessorOptions.h @@ -10,14 +10,16 @@ #ifndef LLVM_CLANG_LEX_PREPROCESSOROPTIONS_H_ #define LLVM_CLANG_LEX_PREPROCESSOROPTIONS_H_ +#include "clang/Basic/SourceLocation.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringSet.h" #include +#include #include #include #include -#include namespace llvm { class MemoryBuffer; @@ -39,23 +41,20 @@ enum ObjCXXARCStandardLibraryKind { /// PreprocessorOptions - This class is used for passing the various options /// used in preprocessor initialization to InitializePreprocessor(). -class PreprocessorOptions : public llvm::RefCountedBase { +class PreprocessorOptions : public RefCountedBase { public: std::vector > Macros; std::vector Includes; std::vector MacroIncludes; - unsigned UsePredefines : 1; /// Initialize the preprocessor with the compiler - /// and target specific predefines. + /// \brief Initialize the preprocessor with the compiler and target specific + /// predefines. + unsigned UsePredefines : 1; + + /// \brief Whether we should maintain a detailed record of all macro + /// definitions and expansions. + unsigned DetailedRecord : 1; - unsigned DetailedRecord : 1; /// Whether we should maintain a detailed - /// record of all macro definitions and - /// expansions. - unsigned DetailedRecordConditionalDirectives : 1; /// Whether in the - /// preprocessing record we should also keep - /// track of locations of conditional directives - /// in non-system files. - /// The implicit PCH included at the start of the translation unit, or empty. std::string ImplicitPCHInclude; @@ -119,14 +118,28 @@ public: /// 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; + /// \brief Records the set of modules + class FailedModulesSet : public RefCountedBase { + llvm::StringSet<> Failed; + + public: + bool hasAlreadyFailed(StringRef module) { + return Failed.count(module) > 0; + } + + void addFailed(StringRef module) { + Failed.insert(module); + } + }; + /// \brief The set of modules that failed to build. + /// + /// This pointer will be shared among all of the compiler instances created + /// to (re)build modules, so that once a module fails to build anywhere, + /// other instances will see that the module has failed and won't try to + /// build it again. + IntrusiveRefCntPtr FailedModules; + typedef std::vector >::iterator remapped_file_iterator; typedef std::vector >::const_iterator @@ -163,7 +176,6 @@ public: public: PreprocessorOptions() : UsePredefines(true), DetailedRecord(false), - DetailedRecordConditionalDirectives(false), DisablePCHValidation(false), AllowPCHWithCompilerErrors(false), DumpDeserializedPCHDecls(false), -- cgit v1.1