C++ atomic's fetch_sub returns the previous value, where we want to
check the new value. This was causing massive memory leaks in SourceKit.
For ThreadSafeRefCountedBase, just switch to the one in LLVM that's
already correct. We should move the VPTR one to LLVM as well and then
we can get rid of this header.
rdar://problem/27358273
This patch allows SourceKit to generate the interface for a given type specified by its mangled name.
Type interface is refined decl printing with type parameters localized and unusable members hidden.
Required field:
"key.request": "source.request.editor.open.interface.swifttype"
"key.usr": the mangled name of the given type.
Cursor info requires access to the underlying AST, which is not
thread-safe. This manifest as crashes when performing concurrent
cursor-info requests on the same generated interface. We already
prevented concurrent cursor-infos on regular Swift files by using the
ASTManager, but generated interfaces use the InterfaceGenContext which
may use either an ASTUnit or its own internal CompilerInstance.
rdar://problem/27311624
Input:
Request Id: 'source.request.editor.open.interface'
Required Field: 'key.modulename'
Optional Field: 'key.groupname'
Output:
If the group name is specified, SourceKit generates interface for the
module group; otherwise does for the entire module.
The code goes into its own sub-tree under 'tools' but tests go under 'test',
so that running 'check-swift' will also run all the SourceKit tests.
SourceKit is disabled on non-darwin platforms.