summaryrefslogtreecommitdiffstats
path: root/include/clang/Lex/PreprocessorOptions.h
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-06-16 20:13:39 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-06-16 20:13:39 +0000
commitfb40328fb184e12d521a3d0179779bf29390b4b7 (patch)
tree321014020bd413bdba3763a43e9a38e70f7715b3 /include/clang/Lex/PreprocessorOptions.h
parent2d736e0181ec273ea6854801561f0a57284c3969 (diff)
[PR33394] Avoid lexing editor placeholders when Clang is used only
for preprocessing r300667 added support for editor placeholder to Clang. That commit didn’t take into account that users who use Clang for preprocessing only (-E) will get the "editor placeholder in source file" error when preprocessing their source (PR33394). This commit ensures that Clang doesn't lex editor placeholders when running a preprocessor only action. rdar://32718000 Differential Revision: https://reviews.llvm.org/D34256 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305576 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/PreprocessorOptions.h')
-rw-r--r--include/clang/Lex/PreprocessorOptions.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h
index f536be8d8e..024db926eb 100644
--- a/include/clang/Lex/PreprocessorOptions.h
+++ b/include/clang/Lex/PreprocessorOptions.h
@@ -98,6 +98,9 @@ public:
/// When enabled, preprocessor is in a mode for parsing a single file only.
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 +188,7 @@ public:
ImplicitPTHInclude.clear();
TokenCache.clear();
SingleFileParseMode = false;
+ LexEditorPlaceholders = true;
RetainRemappedFileBuffers = true;
PrecompiledPreambleBytes.first = 0;
PrecompiledPreambleBytes.second = 0;