Commit Graph

4 Commits

Author SHA1 Message Date
Ben Langmuir
3fa2df68e3 [sourcekit test] Split -sanitizer= test out and add REQUIRES
This test requires the sanitizer runtime libraries, so split it out and
add the requisite REQUIRES lines.
2018-05-18 17:48:31 -07:00
Ben Langmuir
e9d6a4ddfc [sourcekit] Pass -resource-dir when parsing driver arguments
... instead of overriding it after the driver is done. This improves
the fidelity of anything that looks at the resource directory inside the
driver or frontend argument parsing.  In particular, it fixes an issue
where sourcekit requests would fail if they included the -sanitize=
option because the driver would fail to find the runtime libraries.

Even though this should be *more correct* for all uses, in the
interests of understanding all possible immediate effects of this
change, I manually audited all the code that looks at the resource
directory in between when it is parsed as and argument and when
createCompilerInvocation returns. I claim that the only changes are:
1. The sanitizer library check that we wanted to change
2. The DWARFDebugFlags, which are for IRGen so don't affect SourceKit
3. The Migrator data paths, which also don't affect SourceKit

For now, I put the -resource-dir option at the end of the arguments so
that it overrides any existing option, which mimics how it behaved
before.  We might want to move it to the beginning so that we honour a
user-provided resource directory, but that should be a separate change.

rdar://40147839
2018-05-11 10:28:01 -07:00
Ben Langmuir
72bde687e4 [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
2018-02-05 15:49:17 -08:00
Ben Langmuir
d4ae8f611f [sourcekitd] Filter out -v flag
We really need to use the driver for this and stop doing ad-hoc
filtering (rdar://17897287), for for now keep limping along...

rdar://35424741
2017-11-09 11:33:09 -08:00