aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h')
-rw-r--r--contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h33
1 files changed, 25 insertions, 8 deletions
diff --git a/contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h b/contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h
index a7aabc3e1df2..f841e4a028df 100644
--- a/contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h
+++ b/contrib/llvm-project/clang/include/clang/Lex/PreprocessorOptions.h
@@ -10,13 +10,15 @@
#define LLVM_CLANG_LEX_PREPROCESSOROPTIONS_H_
#include "clang/Basic/BitmaskEnum.h"
+#include "clang/Basic/FileEntry.h"
#include "clang/Basic/LLVM.h"
-#include "clang/Lex/PreprocessorExcludedConditionalDirectiveSkipMapping.h"
+#include "clang/Lex/DependencyDirectivesScanner.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include <functional>
#include <map>
#include <memory>
+#include <optional>
#include <set>
#include <string>
#include <utility>
@@ -67,10 +69,16 @@ public:
std::vector<std::string> Includes;
std::vector<std::string> MacroIncludes;
+ /// Perform extra checks when loading PCM files for mutable file systems.
+ bool ModulesCheckRelocated = true;
+
/// Initialize the preprocessor with the compiler and target specific
/// predefines.
bool UsePredefines = true;
+ /// Indicates whether to predefine target OS macros.
+ bool DefineTargetOSMacros = false;
+
/// Whether we should maintain a detailed record of all macro
/// definitions and expansions.
bool DetailedRecord = false;
@@ -128,7 +136,8 @@ public:
///
/// When the lexer is done, one of the things that need to be preserved is the
/// conditional #if stack, so the ASTWriter/ASTReader can save/restore it when
- /// processing the rest of the file.
+ /// processing the rest of the file. Similarly, we track an unterminated
+ /// #pragma assume_nonnull.
bool GeneratePreamble = false;
/// Whether to write comment locations into the PCH when building it.
@@ -199,13 +208,18 @@ public:
/// build it again.
std::shared_ptr<FailedModulesSet> FailedModules;
- /// Contains the currently active skipped range mappings for skipping excluded
- /// conditional directives.
+ /// Function for getting the dependency preprocessor directives of a file.
///
- /// The pointer is passed to the Preprocessor when it's constructed. The
- /// pointer is unowned, the client is responsible for its lifetime.
- ExcludedPreprocessorDirectiveSkipMapping
- *ExcludedConditionalDirectiveSkipMappings = nullptr;
+ /// These are directives derived from a special form of lexing where the
+ /// source input is scanned for the preprocessor directives that might have an
+ /// effect on the dependencies for a compilation unit.
+ ///
+ /// Enables a client to cache the directives for a file and provide them
+ /// across multiple compiler invocations.
+ /// FIXME: Allow returning an error.
+ std::function<std::optional<ArrayRef<dependency_directives_scan::Directive>>(
+ FileEntryRef)>
+ DependencyDirectivesForFile;
/// Set up preprocessor for RunAnalysis action.
bool SetUpStaticAnalyzer = false;
@@ -213,6 +227,9 @@ public:
/// Prevents intended crashes when using #pragma clang __debug. For testing.
bool DisablePragmaDebugCrash = false;
+ /// If set, the UNIX timestamp specified by SOURCE_DATE_EPOCH.
+ std::optional<uint64_t> SourceDateEpoch;
+
public:
PreprocessorOptions() : PrecompiledPreambleBytes(0, false) {}