aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-09-08 16:53:12 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2023-09-08 16:53:12 +0800
commit96122b5b717c2b1a291d7298ac50b1daf02bd97c (patch)
tree4cdf1940c9d6e6f2f4b7d47cb50def4d3ff73f10 /clang/lib/Frontend/ASTUnit.cpp
parent6ffea74f7c2cda7de91879a771daa6d45da198d9 (diff)
downloadllvm-96122b5b717c2b1a291d7298ac50b1daf02bd97c.zip
llvm-96122b5b717c2b1a291d7298ac50b1daf02bd97c.tar.gz
llvm-96122b5b717c2b1a291d7298ac50b1daf02bd97c.tar.bz2
[C++20] [Modules] Introduce ForceCheckCXX20ModulesInputFiles options for
C++20 modules Previously, we banned the check for input files from C++20 modules since we thought the BMI from C++20 modules should be a standalone artifact. However, during the recent experiment with clangd for modules, I find it is necessary to tell whether or not a BMI is out-of-date by checking the input files especially for language servers. So this patch brings a header search option ForceCheckCXX20ModulesInputFiles to allow the tools (concretly, clangd) to check the input files from BMI.
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index a4753f52..167db521 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -550,12 +550,16 @@ public:
bool ReadHeaderSearchOptions(const HeaderSearchOptions &HSOpts,
StringRef SpecificModuleCachePath,
bool Complain) override {
- // Preserve previously set header search paths.
+ // llvm::SaveAndRestore doesn't support bit field.
+ auto ForceCheckCXX20ModulesInputFiles =
+ this->HSOpts.ForceCheckCXX20ModulesInputFiles;
llvm::SaveAndRestore X(this->HSOpts.UserEntries);
llvm::SaveAndRestore Y(this->HSOpts.SystemHeaderPrefixes);
llvm::SaveAndRestore Z(this->HSOpts.VFSOverlayFiles);
this->HSOpts = HSOpts;
+ this->HSOpts.ForceCheckCXX20ModulesInputFiles =
+ ForceCheckCXX20ModulesInputFiles;
return false;
}