Skip to content

Commit 81b0f13

Browse files
Add workaround for the wrong cc1 flag embedded by swift
1 parent 1162e50 commit 81b0f13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,11 @@ void SwiftASTContext::AddExtraClangCC1Args(
17911791
llvm::SmallVector<const char *> clangArgs;
17921792
clangArgs.reserve(source.size());
17931793
llvm::for_each(source, [&](const std::string &Arg) {
1794-
clangArgs.push_back(Arg.c_str());
1794+
// Workaround for the extra driver argument embedded in the swiftmodule by
1795+
// some swift compiler version. It always starts with `--target=` and it is
1796+
// not a valid cc1 option.
1797+
if (!StringRef(Arg).starts_with("--target="))
1798+
clangArgs.push_back(Arg.c_str());
17951799
});
17961800

17971801
std::string diags;

0 commit comments

Comments
 (0)