From: Nico Weber Date: Sun, 6 Jul 2014 03:04:24 +0000 (+0000) Subject: clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed779c533894a66911f4861a30a0cb1b54259c73;p=clang clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212383 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index c65af7f9d1..ae24536515 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -230,7 +230,7 @@ def module_file_deps : Flag<["-"], "module-file-deps">, def header_include_file : Separate<["-"], "header-include-file">, HelpText<"Filename (or -) to write header include output to">; def show_includes : Flag<["--"], "show-includes">, - HelpText<"Print cl.exe style /showIncludes to stderr">; + HelpText<"Print cl.exe style /showIncludes to stdout">; //===----------------------------------------------------------------------===// // Diagnostic Options diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index 6d2e378321..8b2435ba9b 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -49,7 +49,7 @@ public: void clang::AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders, StringRef OutputPath, bool ShowDepth, bool MSStyle) { - raw_ostream *OutputFile = &llvm::errs(); + raw_ostream *OutputFile = MSStyle ? &llvm::outs() : &llvm::errs(); bool OwnsOutputFile = false; // Open the output file, if used. diff --git a/test/Frontend/print-header-includes.c b/test/Frontend/print-header-includes.c index aa3e3971fd..e248c76f97 100644 --- a/test/Frontend/print-header-includes.c +++ b/test/Frontend/print-header-includes.c @@ -1,12 +1,12 @@ -// RUN: %clang_cc1 -include Inputs/test3.h -E -H -o %t.out %s 2> %t.err -// RUN: FileCheck < %t.err %s +// RUN: %clang_cc1 -include Inputs/test3.h -E -H -o %t.out %s 2> %t.stderr +// RUN: FileCheck < %t.stderr %s // CHECK-NOT: test3.h // CHECK: . {{.*test.h}} // CHECK: .. {{.*test2.h}} -// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s 2> %t.err -// RUN: FileCheck --check-prefix=MS < %t.err %s +// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s > %t.stdout +// RUN: FileCheck --check-prefix=MS < %t.stdout %s // MS-NOT: test3.h // MS: Note: including file: {{.*test.h}} // MS: Note: including file: {{.*test2.h}}