[cfe-dev] MSVC compatible driver proposal

Reid Kleckner rnk at google.com
Thu Jun 27 13:45:05 PDT 2013


[Summarizing some offline discussion for the list]

Maybe the way forward is something like this.  First, underlying all the
argv[0] name heuristics is a switch like --driver-flavor=gcc /
--driver-flavor=cl and maybe g++.

We add two more flags to the option table: GCCOption and ClangOption.  When
in gcc driver mode, only clang and gcc options are accepted.  For example,
-fcolor-diagnostics is our preferred spelling of that option, so it gets
the clang flag, and -fdiagnostics-color gets the gcc flag.  When using the
cl driver flavor, we accept cl args and clang args.

We should only put the ClangOption flag on options whose spellings don't
conflict with cl.exe and that fall into the buckets Chandler mentioned:
high-level double dash, or non-conflicting single character group prefix.

GCCOption goes on everything that gcc accepts.  This is actually handy
because there are users who do things like run clang -fsyntax-only and then
invoke gcc for codegen, and they need to know the subset of flags that gcc
supports.

One open question is, is it even worth creating an escape to allow users of
clang-cl to get at the gcc options, or do we tell them not to do that, or
use the private -cc1 options as a hacky workaround?

Similarly, we expect we'll want to be able to invoke cl.exe from clang-cl
if someone asks for an unimplemented feature like /clr:pure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130627/e9d2d04c/attachment.html>


More information about the cfe-dev mailing list