[PATCH] clang-cl: Map /Zi[-] to -f[no-]builtin

Hans Wennborg hans at chromium.org
Thu Aug 8 11:22:41 PDT 2013


Hi rnk,

It seems msbuild.exe passes /Zi by default in release builds, and as far as I can tell, it should map nicely to -fbuiltin.

http://llvm-reviews.chandlerc.com/D1328

Files:
  include/clang/Driver/CLCompatOptions.td
  test/Driver/cl-options.c

Index: include/clang/Driver/CLCompatOptions.td
===================================================================
--- include/clang/Driver/CLCompatOptions.td
+++ include/clang/Driver/CLCompatOptions.td
@@ -77,6 +77,10 @@
 def _SLASH_WX_ : CLFlag<"WX-">, HelpText<"Do not treat warnings as errors">,
   Alias<W_Joined>, AliasArgs<["no-error"]>;
 def _SLASH_w_flag : CLFlag<"w">, HelpText<"Disable all warnings">, Alias<w>;
+def _SLASH_Zi : CLFlag<"Zi">, HelpText<"Enable use of builtin functions">,
+  Alias<fbuiltin>;
+def _SLASH_Zi_ : CLFlag<"Zi-">, HelpText<"Disable use of builtin functions">,
+  Alias<fno_builtin>;
 def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Syntax-check only">,
   Alias<fsyntax_only>;
 
@@ -132,4 +136,3 @@
 def _SLASH_w : CLJoined<"w">;
 def _SLASH_Zc : CLJoined<"Zc:">;
 def _SLASH_ZI : CLFlag<"ZI">;
-def _SLASH_Zi : CLFlag<"Zi">;
Index: test/Driver/cl-options.c
===================================================================
--- test/Driver/cl-options.c
+++ test/Driver/cl-options.c
@@ -76,6 +76,12 @@
 // RUN: %clang_cl /w -### -- %s 2>&1 | FileCheck -check-prefix=w %s
 // w: -w
 
+// RUN: %clang_cl /Zi- /Zi -### -- %s 2>&1 | FileCheck -check-prefix=Zi %s
+// Zi-NOT: -fno-builtin
+
+// RUN: %clang_cl /Zi- -### -- %s 2>&1 | FileCheck -check-prefix=Zi_ %s
+// Zi_: -fno-builtin
+
 // RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s
 // Zs: -fsyntax-only
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1328.1.patch
Type: text/x-patch
Size: 1409 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130808/75703305/attachment.bin>


More information about the cfe-commits mailing list