r191537 - clang-cl: pass /FI options to fallback
Hans Wennborg
hans at hanshq.net
Fri Sep 27 10:54:18 PDT 2013
Author: hans
Date: Fri Sep 27 12:54:18 2013
New Revision: 191537
URL: http://llvm.org/viewvc/llvm-project?rev=191537&view=rev
Log:
clang-cl: pass /FI options to fallback
We started parsing /FI in r191442, and now we can pass it on to the
fallback too.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/cl-fallback.c
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=191537&r1=191536&r2=191537&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Sep 27 12:54:18 2013
@@ -6733,6 +6733,10 @@ Command *visualstudio::Compile::GetComma
if (Args.hasArg(options::OPT_fsyntax_only))
CmdArgs.push_back("/Zs");
+ std::vector<std::string> Includes = Args.getAllArgValues(options::OPT_include);
+ for (size_t I = 0, E = Includes.size(); I != E; ++I)
+ CmdArgs.push_back(Args.MakeArgString(std::string("/FI") + Includes[I]));
+
// Flags that can simply be passed through.
Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LD);
Args.AddAllArgs(CmdArgs, options::OPT__SLASH_LDd);
Modified: cfe/trunk/test/Driver/cl-fallback.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-fallback.c?rev=191537&r1=191536&r2=191537&view=diff
==============================================================================
--- cfe/trunk/test/Driver/cl-fallback.c (original)
+++ cfe/trunk/test/Driver/cl-fallback.c Fri Sep 27 12:54:18 2013
@@ -5,7 +5,7 @@
// command-line option, e.g. on Mac where %s is commonly under /Users.
// RUN: %clang_cl /fallback /Dfoo=bar /Ubaz /Ifoo /O0 /Ox /GR /GR- /LD /LDd \
-// RUN: /MD /MDd /MTd /MT -### -- %s 2>&1 | FileCheck %s
+// RUN: /MD /MDd /MTd /MT /FImyheader.h -### -- %s 2>&1 | FileCheck %s
// CHECK: "-fdiagnostics-format" "msvc-fallback"
// CHECK: ||
// CHECK: cl.exe
@@ -17,6 +17,7 @@
// CHECK: "-I" "foo"
// CHECK: "/Ox"
// CHECK: "/GR-"
+// CHECK: "/FImyheader.h"
// CHECK: "/LD"
// CHECK: "/LDd"
// CHECK: "/MT"
More information about the cfe-commits
mailing list