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) {
902902 new clang::DiagnosticOptions ());
903903 clang::driver::Driver clangDriver (ctx.ClangImporterOpts .clangPath ,
904904 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);
906913 // If an SDK path was explicitly passed to Swift, make sure to pass it to
907914 // Clang driver as well. It affects the resulting include paths.
908915 auto sdkPath = ctx.SearchPathOpts .getSDKPath ();
You can’t perform that action at this time.
0 commit comments