summaryrefslogtreecommitdiff
path: root/include/clang/Lex
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Lex')
-rw-r--r--include/clang/Lex/Preprocessor.h13
-rw-r--r--include/clang/Lex/PreprocessorOptions.h8
2 files changed, 19 insertions, 2 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 302d006ea16ca..712e1ab9fbf5f 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -1835,11 +1835,20 @@ private:
/// \brief A fast PTH version of SkipExcludedConditionalBlock.
void PTHSkipExcludedConditionalBlock();
+ /// Information about the result for evaluating an expression for a
+ /// preprocessor directive.
+ struct DirectiveEvalResult {
+ /// Whether the expression was evaluated as true or not.
+ bool Conditional;
+ /// True if the expression contained identifiers that were undefined.
+ bool IncludedUndefinedIds;
+ };
+
/// \brief Evaluate an integer constant expression that may occur after a
- /// \#if or \#elif directive and return it as a bool.
+ /// \#if or \#elif directive and return a \p DirectiveEvalResult object.
///
/// If the expression is equivalent to "!defined(X)" return X in IfNDefMacro.
- bool EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro);
+ DirectiveEvalResult EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro);
/// \brief Install the standard preprocessor pragmas:
/// \#pragma GCC poison/system_header/dependency and \#pragma once.
diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h
index f536be8d8e691..d91c665cf1dd5 100644
--- a/include/clang/Lex/PreprocessorOptions.h
+++ b/include/clang/Lex/PreprocessorOptions.h
@@ -96,8 +96,15 @@ public:
std::string TokenCache;
/// When enabled, preprocessor is in a mode for parsing a single file only.
+ ///
+ /// Disables #includes of other files and if there are unresolved identifiers
+ /// in preprocessor directive conditions it causes all blocks to be parsed so
+ /// that the client can get the maximum amount of information from the parser.
bool SingleFileParseMode = false;
+ /// When enabled, the preprocessor will construct editor placeholder tokens.
+ bool LexEditorPlaceholders = true;
+
/// \brief True if the SourceManager should report the original file name for
/// contents of files that were remapped to other files. Defaults to true.
bool RemappedFilesKeepOriginalName;
@@ -185,6 +192,7 @@ public:
ImplicitPTHInclude.clear();
TokenCache.clear();
SingleFileParseMode = false;
+ LexEditorPlaceholders = true;
RetainRemappedFileBuffers = true;
PrecompiledPreambleBytes.first = 0;
PrecompiledPreambleBytes.second = 0;