From: David Blaikie Date: Thu, 14 Jun 2018 23:09:06 +0000 (+0000) Subject: Modules: Fix implicit output file for .cppm to .pcm instead of stdout X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f8252fdc23b25455dd20c3e4cf14127c0a65031;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334778 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index b006eb3521..14d94c029d 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -4013,8 +4013,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA, } // Default to writing to stdout? - if (AtTopLevel && !CCGenDiagnostics && - (isa(JA) || JA.getType() == types::TY_ModuleFile)) + if (AtTopLevel && !CCGenDiagnostics && isa(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 index 0000000000..01daecb7f6 --- /dev/null +++ b/test/Driver/clang-translation.cppm @@ -0,0 +1,2 @@ +// RUN: %clang %s --precompile -### 2>&1 | FileCheck %s +// CHECK: "-o" "{{[^"]*}}clang-translation.pcm"