[clang] [clang][modules-driver] Precompile std modules independently of -o and final phase (PR #199289)

Naveen Seth Hanig via cfe-commits cfe-commits at lists.llvm.org
Wed May 27 01:29:34 PDT 2026


================
@@ -73,6 +73,8 @@ TYPE("objective-c++-header-cpp-output", PP_ObjCXXHeader, INVALID,"mii",   phases
 TYPE("objective-c++-header",     ObjCXXHeader, PP_ObjCXXHeader, "h",      phases::Preprocess, phases::Precompile)
 TYPE("c++-module",               CXXModule,    PP_CXXModule,    "cppm",   phases::Preprocess, phases::Precompile, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
 TYPE("c++-module-cpp-output",    PP_CXXModule, INVALID,         "iim",    phases::Precompile, phases::Compile, phases::Backend, phases::Assemble, phases::Link)
+TYPE("c++-std-module",           CXXStdModule, PP_CXXStdModule, "cppm",   phases::Preprocess, phases::Precompile)
+TYPE("c++-std-module-output",    PP_CXXStdModule, INVALID,      "iim",    phases::Precompile)
----------------
naveen-seth wrote:

I might be misunderstanding, but it looks like we already have multiple file kinds sharing the same extension here:

https://github.com/llvm/llvm-project/blob/c94e5f327f47821e29f21b39ef1dc511c91341d9/clang/include/clang/Driver/Types.def#L69-L71

https://github.com/llvm/llvm-project/blob/c94e5f327f47821e29f21b39ef1dc511c91341d9/clang/include/clang/Driver/Types.def#L62-L63

https://github.com/llvm/llvm-project/blob/c94e5f327f47821e29f21b39ef1dc511c91341d9/clang/include/clang/Driver/Types.def#L55-L56

And `.cppm` would still always map to `TY_CXXModule`:
https://github.com/llvm/llvm-project/blob/bf069ec743588b52d3329691113fec9a237f8c7d/clang/lib/Driver/Types.cpp#L398

https://github.com/llvm/llvm-project/pull/199289


More information about the cfe-commits mailing list