]> granicus.if.org Git - clang/commitdiff
clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.
authorNico Weber <nicolasweber@gmx.de>
Sun, 6 Jul 2014 03:04:24 +0000 (03:04 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sun, 6 Jul 2014 03:04:24 +0000 (03:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212383 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/CC1Options.td
lib/Frontend/HeaderIncludeGen.cpp
test/Frontend/print-header-includes.c

index c65af7f9d17f124502176c3cbf713192a3569389..ae245365158ccd436d609c6c92db45c5e09412a7 100644 (file)
@@ -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
index 6d2e3783211a3e6e02af047fb931c79873ff50ed..8b2435ba9be12448d40558c53198f77a85ab7149 100644 (file)
@@ -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.
index aa3e3971fd1b7c6d51cf2cfc90ad4455692b2e22..e248c76f977675f2cb194d2d261cae21f4cefb35 100644 (file)
@@ -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}}