diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-09-07 17:10:07 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2023-09-07 17:13:16 +0800 |
commit | 869111ccf2d3916bf24a31bdb367d7e567483ff0 (patch) | |
tree | b58d9fcd080657ec57c3e774430b14be2aa00a3c /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 31ded495271e5869d619da851a351c9f6f05b2d4 (diff) | |
download | llvm-869111ccf2d3916bf24a31bdb367d7e567483ff0.zip llvm-869111ccf2d3916bf24a31bdb367d7e567483ff0.tar.gz llvm-869111ccf2d3916bf24a31bdb367d7e567483ff0.tar.bz2 |
[NFC] [C++20] [Modules] Refactor the warning to '-fmodule-file=<BMIPath>' for C++20 modules
Previous implementation of the warning to use `-fmodule-file=<BMIPath>`
for C++20 Modules is not straightforward and it is problematic in case
we read the BMIPath by writing tools based clang components. This patch
refactors it with a simple and direct style.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index e500675..49c1d8e 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -1717,7 +1717,8 @@ void CompilerInstance::createASTReader() { Listener->attachToASTReader(*TheASTReader); } -bool CompilerInstance::loadModuleFile(StringRef FileName) { +bool CompilerInstance::loadModuleFile( + StringRef FileName, serialization::ModuleFile *&LoadedModuleFile) { llvm::Timer Timer; if (FrontendTimerGroup) Timer.init("preloading." + FileName.str(), "Preloading " + FileName.str(), @@ -1743,7 +1744,8 @@ bool CompilerInstance::loadModuleFile(StringRef FileName) { // Try to load the module file. switch (TheASTReader->ReadAST( FileName, serialization::MK_ExplicitModule, SourceLocation(), - ConfigMismatchIsRecoverable ? ASTReader::ARR_ConfigurationMismatch : 0)) { + ConfigMismatchIsRecoverable ? ASTReader::ARR_ConfigurationMismatch : 0, + &LoadedModuleFile)) { case ASTReader::Success: // We successfully loaded the module file; remember the set of provided // modules so that we don't try to load implicit modules for them. |