mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[sourcekit] Use the driver to parse command line arguments
Stop parsing frontend arguments directly and use the driver instead. The most intersting part of this change is that it forces us to consider whether our compiler invocation will have inputs or not. We have several kinds of requests that need to create a compiler instance, but not parse any inputs (interface-generation, doc-info, and indexing when operating on a module instead of source files). Incidentally, add an error when trying to do doc-info on multiple source files. This was already very broken (assertion failures and bogus source locations), so add an error for it. rdar://problem/17897287
This commit is contained in:
@@ -1766,7 +1766,8 @@ void SwiftEditorDocument::parse(ImmutableTextSnapshotRef Snapshot,
|
||||
Impl.SemanticInfo->getInvocation()->applyTo(CompInv);
|
||||
Impl.SemanticInfo->getInvocation()->raw(Args, PrimaryFile);
|
||||
} else {
|
||||
ArrayRef<const char *> Args;
|
||||
SmallVector<const char *, 1> Args;
|
||||
Args.push_back(Impl.FilePath.c_str()); // Input
|
||||
std::string Error;
|
||||
// Ignore possible error(s)
|
||||
Lang.getASTManager().
|
||||
|
||||
Reference in New Issue
Block a user