[PATCH] D46394: [clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 3 08:41:38 PDT 2018


erichkeane added inline comments.


================
Comment at: include/clang/Frontend/DependencyOutputOptions.h:31
   unsigned AddMissingHeaderDeps : 1; ///< Add missing headers to dependency list
   unsigned PrintShowIncludes : 1; ///< Print cl.exe style /showIncludes info.
+  unsigned
----------------
Doing these two as separate options is a touch annoying.  First, there is an extra state that ends up being possible but ignored.  I'd prefer making a "PrintShowIncludeDestination : 2" (name open for proper bikeshed) that contains an enum so that the states are explicit.  Something like:
None,
StdOut,
StdErr

That way, the 4th state is explicitly unused.


================
Comment at: test/Driver/cl-options.c:203
-
-// RUN: %clang_cl /EP /P /showIncludes -### -- %s 2>&1 | FileCheck -check-prefix=showIncludes_E_And_P %s
-// showIncludes_E_And_P-NOT: warning: argument unused during compilation: '--show-includes'
----------------
I'm perhaps missing something here... why did "/EP /P /showIncludes" previously NOT warn?  


Repository:
  rC Clang

https://reviews.llvm.org/D46394





More information about the cfe-commits mailing list