File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-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 ();
Original file line number Diff line number Diff line change 26
26
// CHECK-STRING: typealias string = std.{{__cxx11.__CxxTemplateInstNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE|__CxxTemplateInstSs}}
27
27
// CHECK-STRING: typealias wstring = std.{{__cxx11.__CxxTemplateInstNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE|__CxxTemplateInstSbIwSt11char_traitsIwESaIwEE}}
28
28
// CHECK-STD: }
29
+
30
+ // RUN: %target-swift-ide-test -print-module -module-to-print=std -sdk / -Xcc --gcc-toolchain=/usr -source-filename=x -enable-experimental-cxx-interop -module-cache-path %t > %t/interface.swift
You can’t perform that action at this time.
0 commit comments