diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-30 14:26:52 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-30 14:28:11 +0800 |
commit | 6b961e2abfffd8b5a508b5958849b13b0feafa50 (patch) | |
tree | 309e2fdd39437d9830c08b27b29bb3b78ebc66a1 /clang/lib/Serialization/GeneratePCH.cpp | |
parent | 940ef9687f5f19ce02b7fa5d2eb6225f458fbdd9 (diff) | |
download | llvm-6b961e2abfffd8b5a508b5958849b13b0feafa50.zip llvm-6b961e2abfffd8b5a508b5958849b13b0feafa50.tar.gz llvm-6b961e2abfffd8b5a508b5958849b13b0feafa50.tar.bz2 |
Revert "[C++20] [Modules] Don't skip pragma diagnostic mappings"
and "[NFC] [C++20] [Modules] Use new class CXX20ModulesGenerator to
generate module file for C++20 modules instead of PCHGenerator"
This reverts commit fb21343473e33e9a886b42d2fe95d1cec1cd0030.
and commit 18268ac0f48d93c2bcddb69732761971669c09ab.
It looks like there are some problems about linking the compiler
Diffstat (limited to 'clang/lib/Serialization/GeneratePCH.cpp')
-rw-r--r-- | clang/lib/Serialization/GeneratePCH.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp index 53dda5f..bed7439 100644 --- a/clang/lib/Serialization/GeneratePCH.cpp +++ b/clang/lib/Serialization/GeneratePCH.cpp @@ -88,32 +88,36 @@ ASTDeserializationListener *PCHGenerator::GetASTDeserializationListener() { return &Writer; } -CXX20ModulesGenerator::CXX20ModulesGenerator(Preprocessor &PP, - InMemoryModuleCache &ModuleCache, - StringRef OutputFile, - bool GeneratingReducedBMI) +ReducedBMIGenerator::ReducedBMIGenerator(Preprocessor &PP, + InMemoryModuleCache &ModuleCache, + StringRef OutputFile) : PCHGenerator( PP, ModuleCache, OutputFile, llvm::StringRef(), std::make_shared<PCHBuffer>(), /*Extensions=*/ArrayRef<std::shared_ptr<ModuleFileExtension>>(), /*AllowASTWithErrors*/ false, /*IncludeTimestamps=*/false, /*BuildingImplicitModule=*/false, /*ShouldCacheASTInMemory=*/false, - GeneratingReducedBMI) {} + /*GeneratingReducedBMI=*/true) {} -Module *CXX20ModulesGenerator::getEmittingModule(ASTContext &Ctx) { +Module *ReducedBMIGenerator::getEmittingModule(ASTContext &Ctx) { Module *M = Ctx.getCurrentNamedModule(); assert(M && M->isNamedModuleUnit() && - "CXX20ModulesGenerator should only be used with C++20 Named modules."); + "ReducedBMIGenerator should only be used with C++20 Named modules."); return M; } -void CXX20ModulesGenerator::HandleTranslationUnit(ASTContext &Ctx) { +void ReducedBMIGenerator::HandleTranslationUnit(ASTContext &Ctx) { + // We need to do this to make sure the size of reduced BMI not to be larger + // than full BMI. + // // FIMXE: We'd better to wrap such options to a new class ASTWriterOptions // since this is not about searching header really. + // FIXME2: We'd better to move the class writing full BMI with reduced BMI. HeaderSearchOptions &HSOpts = getPreprocessor().getHeaderSearchInfo().getHeaderSearchOpts(); HSOpts.ModulesSkipDiagnosticOptions = true; HSOpts.ModulesSkipHeaderSearchPaths = true; + HSOpts.ModulesSkipPragmaDiagnosticMappings = true; PCHGenerator::HandleTranslationUnit(Ctx); |