]> granicus.if.org Git - clang/commitdiff
clang-cl: Add /FI (forced include) as an alias for -include
authorReid Kleckner <reid@kleckner.net>
Thu, 26 Sep 2013 17:41:14 +0000 (17:41 +0000)
committerReid Kleckner <reid@kleckner.net>
Thu, 26 Sep 2013 17:41:14 +0000 (17:41 +0000)
Patch by Jeff Muizelaar, with added test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191442 91177308-0d34-0410-b5e6-96231b3b80d8

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

index c912accd25464b5810311e1b0b2df76cff60e901..aae4d0a6ec38a2df41e82cc3a298e59f67f375ca 100644 (file)
@@ -112,6 +112,8 @@ def _SLASH_M_Group : OptionGroup<"</M group>">, Group<cl_compile_Group>;
 
 def _SLASH_fallback : CLCompileFlag<"fallback">,
   HelpText<"Fall back to cl.exe if clang-cl fails to compile">;
+def _SLASH_FI : CLJoined<"FI">,
+  HelpText<"Include file before parsing">, Alias<include_>;
 def _SLASH_Fe : CLJoined<"Fe">,
   HelpText<"Set output executable file or directory (ends in / or \\)">,
   MetaVarName<"<file or directory>">;
index c3a90ced20899af99e43ae4aee2eff01c19498cb..e9e18582e3c2171d985de142c6ef39e29c3f68ca 100644 (file)
@@ -20,9 +20,9 @@
 // RUN: %clang_cl /GR- -### -- %s 2>&1 | FileCheck -check-prefix=GR_ %s
 // GR_: -fno-rtti
 
-// RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=I %s
-// RUN: %clang_cl /I myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=I %s
-// I: "-I" "myincludedir"
+// RUN: %clang_cl /Imyincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
+// RUN: %clang_cl /I myincludedir -### -- %s 2>&1 | FileCheck -check-prefix=SLASH_I %s
+// SLASH_I: "-I" "myincludedir"
 
 // RUN: %clang_cl /J -### -- %s 2>&1 | FileCheck -check-prefix=J %s
 // J: -fno-signed-char
@@ -88,6 +88,9 @@
 // RUN: %clang_cl /Zs -### -- %s 2>&1 | FileCheck -check-prefix=Zs %s
 // Zs: -fsyntax-only
 
+// RUN: %clang_cl /FIasdf.h -### -- %s 2>&1 | FileCheck -check-prefix=FI %s
+// FI: "-include" "asdf.h"
+
 // We forward any unrecognized -W diagnostic options to cc1.
 // RUN: %clang_cl -Wunused-pragmas -### -- %s 2>&1 | FileCheck -check-prefix=WJoined %s
 // WJoined: "-cc1"