[clang] [C++][Modules] Don't insert `#include` before GMF when `-include` used (PR #212533)
Yihan Wang via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 28 18:52:14 PDT 2026
================
@@ -142,6 +142,21 @@ void printDependencyDirectivesAsSource(
/// \returns true if any C++20 named modules related directive was found.
bool scanInputForCXX20ModulesUsage(StringRef Source);
+/// Describes how a source input starts a C++20 module unit.
+enum class ModuleUnitKind {
+ NotModuleUnit,
+ HasGlobalModuleFragment,
+ NamedModuleWithoutGlobalModuleFragment,
+};
+
+/// Scan an input source buffer to determine whether it starts a C++20 module
+/// unit, and whether that module unit has a global module fragment.
+///
+/// \param Source The input source buffer.
+///
+/// \returns the kind of C++20 module unit found in the input.
+ModuleUnitKind scanInputForCXX20ModuleUnit(StringRef Source);
----------------
yronglin wrote:
Let me try.
https://github.com/llvm/llvm-project/pull/212533
More information about the cfe-commits
mailing list