summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex/Preprocessor.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-06-20 14:36:58 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-06-20 14:36:58 +0000
commit7a2305ca4dfb7a94e5e524ed034aeb3768d8bf9a (patch)
tree211da497bef019d483f5da3c41911c74f871df5e /include/clang/Lex/Preprocessor.h
parent61d542a8476a6e51a76b7d9c135ca1a335479ce2 (diff)
[preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, parse all directive blocks if the condition uses undefined macros
This is useful for being able to parse the preprocessor directive blocks even if the header, that defined the macro that is checked, hasn't been included. Differential Revision: https://reviews.llvm.org/D34263 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r--include/clang/Lex/Preprocessor.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 302d006ea1..712e1ab9fb 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.