diff options
Diffstat (limited to 'include/clang/Lex/PreprocessorOptions.h')
-rw-r--r-- | include/clang/Lex/PreprocessorOptions.h | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h index e5fe37379355..eba2a13342f5 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 <cassert> +#include <set> #include <string> #include <utility> #include <vector> -#include <set> 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<PreprocessorOptions> { +class PreprocessorOptions : public RefCountedBase<PreprocessorOptions> { public: std::vector<std::pair<std::string, bool/*isUndef*/> > Macros; std::vector<std::string> Includes; std::vector<std::string> 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<std::string, 2> ModuleBuildPath; + /// \brief Records the set of modules + class FailedModulesSet : public RefCountedBase<FailedModulesSet> { + 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<FailedModulesSet> FailedModules; + typedef std::vector<std::pair<std::string, std::string> >::iterator remapped_file_iterator; typedef std::vector<std::pair<std::string, std::string> >::const_iterator @@ -163,7 +176,6 @@ public: public: PreprocessorOptions() : UsePredefines(true), DetailedRecord(false), - DetailedRecordConditionalDirectives(false), DisablePCHValidation(false), AllowPCHWithCompilerErrors(false), DumpDeserializedPCHDecls(false), |