r334778 - Modules: Fix implicit output file for .cppm to .pcm instead of stdout

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 14 16:09:06 PDT 2018


Author: dblaikie
Date: Thu Jun 14 16:09:06 2018
New Revision: 334778

URL: http://llvm.org/viewvc/llvm-project?rev=334778&view=rev
Log:
Modules: Fix implicit output file for .cppm to .pcm instead of stdout

This code was introduced back in r178148, a change to introduce
-module-file-info - which still exists & seems like it's still tested (&
this change didn't cause any of those tests to fail).

It doesn't look like this change was necessary there - since it's about
pcm output, whereas -module-file-info looks like it's for pcm /input/.
So I'm not really sure what the original motivation was.

I'm open to ideas though, if it turns out the original change was
necessary/useful.

Added:
    cfe/trunk/test/Driver/clang-translation.cppm
Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=334778&r1=334777&r2=334778&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Thu Jun 14 16:09:06 2018
@@ -4013,8 +4013,7 @@ const char *Driver::GetNamedOutputPath(C
   }
 
   // Default to writing to stdout?
-  if (AtTopLevel && !CCGenDiagnostics &&
-      (isa<PreprocessJobAction>(JA) || JA.getType() == types::TY_ModuleFile))
+  if (AtTopLevel && !CCGenDiagnostics && isa<PreprocessJobAction>(JA))
     return "-";
 
   // Is this the assembly listing for /FA?

Added: cfe/trunk/test/Driver/clang-translation.cppm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-translation.cppm?rev=334778&view=auto
==============================================================================
--- cfe/trunk/test/Driver/clang-translation.cppm (added)
+++ cfe/trunk/test/Driver/clang-translation.cppm Thu Jun 14 16:09:06 2018
@@ -0,0 +1,2 @@
+// RUN: %clang %s --precompile -### 2>&1 | FileCheck %s
+// CHECK: "-o" "{{[^"]*}}clang-translation.pcm"




More information about the cfe-commits mailing list