diff options
author | Evgeny Mankov <evgeny.mankov@gmail.com> | 2019-08-27 22:15:32 +0000 |
---|---|---|
committer | Evgeny Mankov <evgeny.mankov@gmail.com> | 2019-08-27 22:15:32 +0000 |
commit | 2ed2e62498b7cccf951b7c671498625cecd2a862 (patch) | |
tree | 55eec008498bc42eae38b77d850d0c7e8a042a48 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 1fac68b0dc19b03fd2c5e9856f0f2c5a11691348 (diff) | |
download | bcm5719-llvm-2ed2e62498b7cccf951b7c671498625cecd2a862.tar.gz bcm5719-llvm-2ed2e62498b7cccf951b7c671498625cecd2a862.zip |
[preprocessor] Add an opportunity to retain excluded conditional blocks
It is handy for clang tooling, for instance, in source to source transformation.
Reviewers: vpykhtin (Valery Pykhtin), erichkeane (Erich Keane)
Subscribers: rsmith (Richard Smith), akyrtzi (Argyrios Kyrtzidis)
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66597
llvm-svn: 370123
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index ac6e6b6048e..35348ffe13b 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1735,6 +1735,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine( bool CacheCodeCompletionResults, bool IncludeBriefCommentsInCodeCompletion, bool AllowPCHWithCompilerErrors, SkipFunctionBodiesScope SkipFunctionBodies, bool SingleFileParse, bool UserFilesAreVolatile, bool ForSerialization, + bool RetainExcludedConditionalBlocks, llvm::Optional<StringRef> ModuleFormat, std::unique_ptr<ASTUnit> *ErrAST, IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) { assert(Diags.get() && "no DiagnosticsEngine was provided"); @@ -1762,6 +1763,7 @@ ASTUnit *ASTUnit::LoadFromCommandLine( PPOpts.RemappedFilesKeepOriginalName = RemappedFilesKeepOriginalName; PPOpts.AllowPCHWithCompilerErrors = AllowPCHWithCompilerErrors; PPOpts.SingleFileParseMode = SingleFileParse; + PPOpts.RetainExcludedConditionalBlocks = RetainExcludedConditionalBlocks; // Override the resources path. CI->getHeaderSearchOpts().ResourceDir = ResourceFilesPath; |