[PATCH] D137058: [Driver] [Modules] Support -fsave-std-c++-module-file (1/2)

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 09:34:40 PST 2022


dblaikie added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:5541-5542
+  //
+  // FIXME: Do we need to handle the case that the calculated output is
+  // conflicting with the specified output file or the input file?
+  if (!AtTopLevel && isa<PrecompileJobAction>(JA) &&
----------------
Do we do that for `-o` today? (eg: if you try to `-o` and specify the input file name, such that the output would overwrite the input, what happens? I'm not sure - but I guess it's OK to do whatever that is for this case too)


================
Comment at: clang/test/Driver/save-std-c++-module-file.cpp:1-11
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: split-file %s %t
+//
+// RUN: %clang -std=c++20 %t/Hello.cppm -fsave-std-c++-module-file -c
+// RUN: ls %t | FileCheck %t/Hello.cppm --check-prefix=CHECK-DEFAULT
+//
----------------
Usually driver tests only invoke the driver and observe the output using `-###` to see what subcommands the driver would run. Could this test be phrased in that way? (testing whatever command line is expected to be invoked, rather than the actual behavior of the frontend)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137058/new/

https://reviews.llvm.org/D137058



More information about the cfe-commits mailing list