From: Hans Wennborg Date: Fri, 27 Sep 2013 17:54:18 +0000 (+0000) Subject: clang-cl: pass /FI options to fallback X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fe475a1a1d333d4ddeca386fa8dae3448103c3a;p=clang clang-cl: pass /FI options to fallback We started parsing /FI in r191442, and now we can pass it on to the fallback too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191537 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 6edb44732f..cb28cd140f 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -6733,6 +6733,10 @@ Command *visualstudio::Compile::GetCommand(Compilation &C, const JobAction &JA, if (Args.hasArg(options::OPT_fsyntax_only)) CmdArgs.push_back("/Zs"); + std::vector 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); diff --git a/test/Driver/cl-fallback.c b/test/Driver/cl-fallback.c index a80068bce4..2433072a02 100644 --- a/test/Driver/cl-fallback.c +++ b/test/Driver/cl-fallback.c @@ -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"