]> granicus.if.org Git - clang/commitdiff
Modules: Fix implicit output file for .cppm to .pcm instead of stdout
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 14 Jun 2018 23:09:06 +0000 (23:09 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 14 Jun 2018 23:09:06 +0000 (23:09 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
test/Driver/clang-translation.cppm [new file with mode: 0644]

index b006eb3521f6b528f2fb06a3c04da7ca33c6b2cd..14d94c029d5f9ca78ee6c83d065f976579887a38 100644 (file)
@@ -4013,8 +4013,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA,
   }
 
   // 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?
diff --git a/test/Driver/clang-translation.cppm b/test/Driver/clang-translation.cppm
new file mode 100644 (file)
index 0000000..01daecb
--- /dev/null
@@ -0,0 +1,2 @@
+// RUN: %clang %s --precompile -### 2>&1 | FileCheck %s
+// CHECK: "-o" "{{[^"]*}}clang-translation.pcm"