Author: Chuanqi Xu Date: 2022-11-08T15:58:46+08:00 New Revision: d1f90b61292045d395ba5b94bc9098f4b5d4e55d
URL: https://github.com/llvm/llvm-project/commit/d1f90b61292045d395ba5b94bc9098f4b5d4e55d DIFF: https://github.com/llvm/llvm-project/commit/d1f90b61292045d395ba5b94bc9098f4b5d4e55d.diff LOG: [NFC] [C++20] [Modules] Rename ASTWriter::isWritingStdCXXNamedModules According to the discussion in https://discourse.llvm.org/t/rfc-unifying-the-terminology-about-modules-in-clang/66054, this patch rename ASTWriter::isWritingNamedModules to ASTWriter::isWrittingStdCXXNamedModules to make the name more clear. Added: Modified: clang/include/clang/Basic/Module.h clang/include/clang/Serialization/ASTWriter.h clang/lib/Serialization/ASTWriter.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index 3e9669ced1009..c41ae41737898 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -159,7 +159,8 @@ class alignas(8) Module { /// eventually be exposed, for use in "private" modules. std::string ExportAsModule; - /// Does this Module scope describe part of the purview of a named C++ module? + /// Does this Module scope describe part of the purview of a standard named + /// C++ module? bool isModulePurview() const { return Kind == ModuleInterfaceUnit || Kind == ModulePartitionInterface || Kind == ModulePartitionImplementation || diff --git a/clang/include/clang/Serialization/ASTWriter.h b/clang/include/clang/Serialization/ASTWriter.h index cb929fc19bd21..09ee1744e8945 100644 --- a/clang/include/clang/Serialization/ASTWriter.h +++ b/clang/include/clang/Serialization/ASTWriter.h @@ -736,7 +736,7 @@ class ASTWriter : public ASTDeserializationListener, bool hasChain() const { return Chain; } ASTReader *getChain() const { return Chain; } - bool isWritingNamedModules() const { + bool isWritingStdCXXNamedModules() const { return WritingModule && WritingModule->isModulePurview(); } diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 3658d69908c3c..1dcb5426b314d 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -4334,7 +4334,8 @@ void ASTRecordWriter::AddAttr(const Attr *A) { // FIXME: Clang can't handle the serialization/deserialization of // preferred_name properly now. See // https://github.com/llvm/llvm-project/issues/56490 for example. - if (!A || (isa<PreferredNameAttr>(A) && Writer->isWritingNamedModules())) + if (!A || (isa<PreferredNameAttr>(A) && + Writer->isWritingStdCXXNamedModules())) return Record.push_back(0); Record.push_back(A->getKind() + 1); // FIXME: stable encoding, target attrs _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits