[clang] [C++20] [Modules] Introduce -fexperimental-modules-reduced-bmi (PR #85050)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 1 11:17:17 PDT 2024


================
@@ -193,6 +193,20 @@ DwarfFissionKind getDebugFissionKind(const Driver &D,
                                      const llvm::opt::ArgList &Args,
                                      llvm::opt::Arg *&Arg);
 
+// Calculate the output path of the module file when compiling a module unit
+// with the `-fmodule-output` option or `-fmodule-output=` option specified.
+// The behavior is:
+// - If `-fmodule-output=` is specfied, then the module file is
+//   writing to the value.
+// - Otherwise if the output object file of the module unit is specified, the
+// output path
+//   of the module file should be the same with the output object file except
+//   the corresponding suffix. This requires both `-o` and `-c` are specified.
+// - Otherwise, the output path of the module file will be the same with the
+//   input with the corresponding suffix.
+llvm::SmallString<256>
+getCXX20NamedModuleOutputPath(const llvm::opt::ArgList &Args,
----------------
dwblaikie wrote:

Pulling this work out into a named function could probably be a preliminary NFC commit?

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


More information about the cfe-commits mailing list