File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -902,7 +902,14 @@ getClangInvocationFileMapping(ASTContext &ctx) {
902
902
new clang::DiagnosticOptions ());
903
903
clang::driver::Driver clangDriver (ctx.ClangImporterOpts .clangPath ,
904
904
triple.str (), *clangDiags);
905
- llvm::opt::InputArgList clangDriverArgs;
905
+ // Flags passed to Swift with `-Xcc` might affect include paths.
906
+ unsigned unused1, unused2;
907
+ std::vector<const char *> clangArgs;
908
+ for (const auto &each : ctx.ClangImporterOpts .ExtraArgs ) {
909
+ clangArgs.push_back (each.c_str ());
910
+ }
911
+ llvm::opt::InputArgList clangDriverArgs =
912
+ clangDriver.getOpts ().ParseArgs (clangArgs, unused1, unused2);
906
913
// If an SDK path was explicitly passed to Swift, make sure to pass it to
907
914
// Clang driver as well. It affects the resulting include paths.
908
915
auto sdkPath = ctx.SearchPathOpts .getSDKPath ();
You can’t perform that action at this time.
0 commit comments