Author: hans
Date: Mon Sep  9 14:04:49 2013
New Revision: 190323

URL: http://llvm.org/viewvc/llvm-project?rev=190323&view=rev
Log:
clang-cl: parse (but don't support) the /o flag

Apparently folks run into this (PR17097). The flag is not supported by
MSVC either, but we should parse it so we don't get confused when it occurs.

This changes the clang-cl output for "clang-cl /c /o foo.obj" from:

  clang-cl.exe: error: no such file or directory: '/o'
  clang-cl.exe: error: no such file or directory: 'foo.obj'

to:

  clang-cl.exe: warning: argument unused during compilation: '/o bajs.obj'

Modified:
    cfe/trunk/include/clang/Driver/CLCompatOptions.td
    cfe/trunk/test/Driver/cl-options.c

Modified: cfe/trunk/include/clang/Driver/CLCompatOptions.td
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CLCompatOptions.td?rev=190323&r1=190322&r2=190323&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/CLCompatOptions.td (original)
+++ cfe/trunk/include/clang/Driver/CLCompatOptions.td Mon Sep  9 14:04:49 2013
@@ -143,6 +143,7 @@ def _SLASH_Gy : CLFlag<"Gy">;
 def _SLASH_Gy_ : CLFlag<"Gy-">;
 def _SLASH_GZ : CLFlag<"GZ">;
 def _SLASH_MP : CLJoined<"MP">;
+def _SLASH_o : CLJoinedOrSeparate<"o">;
 def _SLASH_w : CLJoined<"w">;
 def _SLASH_Za : CLFlag<"Za">;
 def _SLASH_Zc : CLJoined<"Zc:">;

Modified: cfe/trunk/test/Driver/cl-options.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-options.c?rev=190323&r1=190322&r2=190323&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-options.c (original)
+++ cfe/trunk/test/Driver/cl-options.c Mon Sep  9 14:04:49 2013
@@ -107,6 +107,7 @@
 // (/Zs is for syntax-only)
 // RUN: %clang_cl /Zs /EHsc /Fdfoo /fp:precise /Gd /GL /GL- -- %s 2>&1
 // RUN: %clang_cl /Zs /Gm /Gm- /GS /Gy /Gy- /GZ -- %s 2>&1
+// RUN: %clang_cl /Zs /ofoo.obj /o foo.obj -- %s 2>&1
 // RUN: %clang_cl /Zs /wfoo /Zc:wchar_t- -- %s 2>&1
 // RUN: %clang_cl /Zs /ZI /Zi /MP -- %s 2>&1
 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to